<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Kyle Brumm</title>
    <description>Musings from development escapades.</description>
    <link>https://kylebrumm.com/</link>
    <atom:link href="https://kylebrumm.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 05 Mar 2025 23:16:06 +0000</pubDate>
    <lastBuildDate>Wed, 05 Mar 2025 23:16:06 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Adding a Spotify &quot;Currently Playing&quot; Widget to Your Website</title>
        <description>&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; This article is no longer up to date. Please visit the &lt;a href=&quot;http://kylebrumm.com/spotifyCurrentlyPlaying.js/&quot;&gt;spotifyCurrentlyPlaying.js&lt;/a&gt; website to get started.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://kylebrumm.com/media/posts/spotify-currently-playing.png&quot; alt=&quot;spotifyCurrentlyPlaying.js&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;When I started working on my new site, I was trying to come up with unique features that you don’t really see on other portfolio sites. I thought it would be cool to allow people to see what song I am currently listening to, or at least the song I have listened to most recently. I am a lover of &lt;a href=&quot;https://www.spotify.com/&quot;&gt;Spotify&lt;/a&gt; and listen to basically all my music on it. I did some digging into their API and found that there isn’t a way to get a users most recent song, so I made a workaround, using &lt;a href=&quot;http://www.netlingo.com/word/scrobble.php&quot;&gt;“scrobbling”&lt;/a&gt; and &lt;a href=&quot;http://www.last.fm/&quot;&gt;Last.fm&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;getting-set-up&quot;&gt;Getting Set Up&lt;/h3&gt;

&lt;p&gt;First things first, head on over to Github, &lt;a href=&quot;https://github.com/kjbrum/spotify-currently-playing&quot;&gt;download the repo&lt;/a&gt;, and add it to your project. Before you can use the plugin, you will need to have Spotify and Last.fm accounts set up, as well as a &lt;a href=&quot;http://www.last.fm/api&quot;&gt;Last.fm API key&lt;/a&gt;. Once you have all that set up, you will need to connect your Last.fm account to your Spotify account. You can do this by opening the desktop application and going to “Preferences”. You will see a section with the heading “LAST.FM”. Enter your username and password to give Spotify access.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://kylebrumm.com/media/posts/lastfm-connect.png&quot; alt=&quot;LastFM Connect&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Once you have that done, Spotify will be able to “scrobble” the songs you play to Last.fm. The next step is to use Last.fm’s API to get that information. Lucky for you, the plugin handles all that. All you need to do is initialize it. You can do so by using a selector for the container you want the Spotify player to render in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Something like this will do the trick:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$(&apos;.js-current-track&apos;).spotify({
    width: &apos;100%&apos;,
    height: 400,
    username: &apos;YOUR_USERNAME&apos;,
    api_key: &apos;YOUR_API_KEY&apos;
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;All you need to do is pass in an options object with your desired width and height (optional), as well as your Last.fm username and API key.&lt;/p&gt;

&lt;p&gt;That should do it. You should be able to navigate to the page on your site that has the targeted element and see a Spotify player rendered with your most recent Spotify song.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://kylebrumm.com/media/posts/spotify-player.png&quot; alt=&quot;Spotify Player&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you ran into any issues, let me know in the comments!&lt;/p&gt;
</description>
        <pubDate>Sun, 15 Nov 2015 00:00:00 +0000</pubDate>
        <link>https://kylebrumm.com/adding-a-spotify-currently-playing-widget-to-your-website</link>
        <guid isPermaLink="true">https://kylebrumm.com/adding-a-spotify-currently-playing-widget-to-your-website</guid>
        
        
        <category>Tips &amp; Tricks</category>
        
        <category>JavaScript</category>
        
      </item>
    
      <item>
        <title>Hiding the H1 Option in the WordPress Editor</title>
        <description>&lt;p&gt;Often when creating a WordPress theme, I will program the &lt;code&gt;page.php&lt;/code&gt; template file to display the post title with an &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; tag. Now I’m not an SEO strategist, but I do know that you are only suppose to have one &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; tag on a page. Because of this, it makes sense to not allow the end user of the theme to add &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; tags to their post content.&lt;/p&gt;

&lt;p&gt;This little snippet will modify the TinyMCE editor, and remove the “Heading 1” option from the formatting dropdown. This should allow to rest easy, assuming the client doesn’t decide to add the tag manually…&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/kjbrum/da4eb508be09b9c336a9.js&quot;&gt;&lt;/script&gt;

</description>
        <pubDate>Tue, 29 Sep 2015 00:00:00 +0000</pubDate>
        <link>https://kylebrumm.com/hiding-the-h1-option-in-the-wordpress-editor</link>
        <guid isPermaLink="true">https://kylebrumm.com/hiding-the-h1-option-in-the-wordpress-editor</guid>
        
        
        <category>Snippets</category>
        
        <category>WordPress</category>
        
      </item>
    
      <item>
        <title>Search and Kill Processes</title>
        <description>&lt;p&gt;The other day I was working on getting a Vagrant box set up. I ran into an issue where I couldn’t destroy the box and couldn’t find out why. I ended up needing to kill all the Vagrant processes that were running on my machine.&lt;/p&gt;

&lt;p&gt;I learned that it’s not exactly the easiest to search for a process and kill it, so I decided to make a little bash script that would let me search all the processes for a string. This would then return an array of process IDs that I could loop through, and kill, one by one.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Caution:&lt;/strong&gt; Beware what processes you are killing, you could get undesired results.&lt;/em&gt;&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/kjbrum/ced851437f3fb8190299.js&quot;&gt;&lt;/script&gt;

</description>
        <pubDate>Mon, 17 Aug 2015 00:00:00 +0000</pubDate>
        <link>https://kylebrumm.com/search-and-kill-processes</link>
        <guid isPermaLink="true">https://kylebrumm.com/search-and-kill-processes</guid>
        
        
        <category>Bash</category>
        
      </item>
    
      <item>
        <title>My Personal Bash Profile</title>
        <description>&lt;p&gt;I don’t know about anyone else, but I love finding and creating new things to put in my &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bash_profile&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I like to think that I have a lot of useful things in mine so I figured it would be nice to share it with everyone. I update it every now and then, so you can always check back for an updated version.&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/kjbrum/77b7af04191267b053e9.js&quot;&gt;&lt;/script&gt;

</description>
        <pubDate>Wed, 05 Aug 2015 00:00:00 +0000</pubDate>
        <link>https://kylebrumm.com/my-personal-bash-profile</link>
        <guid isPermaLink="true">https://kylebrumm.com/my-personal-bash-profile</guid>
        
        
        <category>Bash</category>
        
      </item>
    
      <item>
        <title>The Ultimate WordPress Setup</title>
        <description>&lt;p&gt;&lt;img src=&quot;https://kylebrumm.com/media/posts/the-ultimate-wp-setup.jpg&quot; alt=&quot;The Ultimate WordPress Setup&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you haven&apos;t noticed by now, here at Happy Medium, we like to make WordPress sites. The majority of our sites we create are done with &lt;a href=&quot;https://wordpress.org/&quot;&gt;WordPress&lt;/a&gt;. I don&apos;t think I&apos;m alone when I say setting up a new project sucks. There are just so many things you have to remember to do and it seems like a never ending list. When I started at Happy Medium, I remember learning the process of setting up a new website, it was a lot to remember. It&apos;s not like it was &lt;em&gt;terrible&lt;/em&gt; or anything, it was just a lot for a new employee&amp;nbsp;to learn, as well as being pretty time consuming. If you read my last blog post, you may recall me saying that&amp;nbsp;if I can make something more efficient, I am going to. &amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;h2 id=&quot;theproblem&quot;&gt;THE PROBLEM:&lt;/h2&gt;

&lt;p&gt;Let me give you an example. I have a task to set up a new WordPress site for &quot;Client X&quot;. A typical workflow would look something like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a&amp;nbsp;&lt;a href=&quot;https://git-scm.com/&quot;&gt;Git&lt;/a&gt; repository (&lt;a href=&quot;https://github.com/&quot;&gt;Github&lt;/a&gt; / &lt;a href=&quot;https://bitbucket.org/&quot;&gt;BitBucket&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Setup a staging server&lt;/li&gt;
&lt;li&gt;Clone our base WordPress repo&lt;/li&gt;
&lt;li&gt;Clone our base plugin and theme&lt;/li&gt;
&lt;li&gt;Create a local database&lt;/li&gt;
&lt;li&gt;Run the, &lt;em&gt;very simple&lt;/em&gt;, prepare script&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That&apos;s just to name a few, but if you are like us, you have a laundry list of tasks to complete before actually have&amp;nbsp;a new site up and running. For setting things up, we&amp;nbsp;use a tool called&amp;nbsp;&lt;a href=&quot;https://github.com/Mixd/wp-deploy&quot;&gt;wp-deploy&lt;/a&gt;.&amp;nbsp;It&apos;s a framework for deploying WordPress sites using &lt;a href=&quot;http://capistranorb.com/&quot;&gt;Capistrano&lt;/a&gt;, it&apos;s pretty amazing. Along with deployment, it also has WordPress included as a &lt;a href=&quot;https://git-scm.com/book/en/v2/Git-Tools-Submodules&quot;&gt;submodule&lt;/a&gt;. Now this is all fine and dandy, but it doesn&apos;t help a whole lot with the initial setup of a site.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://kylebrumm.com/media/posts/struggle-puppy.gif&quot; alt=&quot;Struggle Puppy&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;h2 id=&quot;thesolution&quot;&gt;THE SOLUTION:&lt;/h2&gt;

&lt;p&gt;I have been trying to learn more about bash scripting lately, so I figured this would be a great opportunity to learn a few things and make the team&apos;s lives a little easier. I started&amp;nbsp;by breaking the setup process into small chunks and tackling them one by one. I started with the base &lt;a href=&quot;https://github.com/Mixd/wp-deploy/blob/master/config/prepare.sh&quot;&gt;prepare.sh&lt;/a&gt; script and expanded on it. The&amp;nbsp;overall goal of the script was to make it so the user would only have to answer simple prompts and make as few decisions as possible.&lt;/p&gt;

&lt;h3 id=&quot;configuration&quot;&gt;CONFIGURATION&lt;/h3&gt;

&lt;p&gt;The first thing you have to do with a new wp-deploy project, is setup your configuration file.&amp;nbsp;The simplest thing to do was to ask the user to input the project &quot;slug&quot;. If we continue with our example, our slug would be &quot;clientx&quot;. Once the user inputs the project slug, it&apos;s smooth sailing from their.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Before running the script, you will need to add your credentials to the config.cfg file. This is used to&amp;nbsp;keep your personal information in it&apos;s own file and separate from the script.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tasks Completed:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clone the latest version of WordPress&lt;/li&gt;
&lt;li&gt;Update the configuration files with the project slug&lt;/li&gt;
&lt;li&gt;Create a local database&lt;/li&gt;
&lt;li&gt;Install Ruby dependencies&lt;/li&gt;
&lt;li&gt;Set up WordPress locally&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;bitbucket&quot;&gt;BITBUCKET&lt;/h3&gt;

&lt;p&gt;Here at HM, we like to use Bitbucket for storing our projects. If you don&apos;t use version control, you should! For every project we need to create a new repository for storing the code. To make this work, I used BitBuckets API. After running a couple &lt;a href=&quot;http://curl.haxx.se/&quot;&gt;curl&lt;/a&gt; requests you will have a new repository with all your&amp;nbsp;deployment keys. &lt;a href=&quot;https://confluence.atlassian.com/display/BITBUCKET/repository+Resource#repositoryResource-POSTanewrepository&quot;&gt;Read More on the BitBucket API.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Your deployment keys will need to be added to the deployment.txt file. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tasks Completed:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a BitBucket repository using the project slug&lt;/li&gt;
&lt;li&gt;Add your deployment keys to the new repository&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;serverpilot&quot;&gt;SERVERPILOT&lt;/h3&gt;

&lt;p&gt;We use ServerPilot for managing all our projects and servers. Just like our repository, we need to set up a new staging site. I took the same approach with this, using a couple curl requests got the job done.&amp;nbsp;I found out that when you create a new ServerPilot app, it isn&apos;t instantly available to have a database added to it. To fix this&amp;nbsp;I had to do a bit of text parsing in order to get the information I needed. I stored&amp;nbsp;the app creation request&amp;nbsp;in a variable and then parsed it to get the new app ID&amp;nbsp;(used to create the database) and the action ID (used to check when the app was created). After the app was finished being created, I was able to add a database using the previously parsed app ID. &lt;a href=&quot;https://github.com/ServerPilot/API&quot;&gt;Read more on the ServerPilot API.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tasks Completed:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new ServerPilot application&lt;/li&gt;
&lt;li&gt;Create a new database for the application (randomly generated username and password)&lt;/li&gt;
&lt;li&gt;Update the database.yml with the database credentials&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;pluginsthemes&quot;&gt;PLUGINS/THEMES&lt;/h3&gt;

&lt;p&gt;For most projects, we have our own plugin and theme that we have rolled up to help get things started and create consistency. Along with those we have a few plugins that find their way into almost every project as well. To get these set up, we would have to clone each one of them into their respective directories&amp;nbsp;(plugins or themes). Additionally, our theme comes Grunt ready with a few helpful tasks (Sass compiling, minification, browser syncing, SVG spriting). In order for all these to work properly, we have to install our &lt;abbr title=&quot;Node Package Manager&quot;&gt;NPM&lt;/abbr&gt; packages and run our default&amp;nbsp;Grunt task. Simple enough, just a couple commands and we&apos;re good to go!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tasks Completed:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clone the needed plugins and themes&lt;/li&gt;
&lt;li&gt;Update the Gruntfile with our project slug&lt;/li&gt;
&lt;li&gt;Install NPM packages&lt;/li&gt;
&lt;li&gt;Run the initial Grunt task&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;miscellaneous&quot;&gt;MISCELLANEOUS&lt;/h3&gt;

&lt;p&gt;There is an amazing WordPress tool call &lt;a href=&quot;http://wp-cli.org/&quot;&gt;WP-CLI&lt;/a&gt;&amp;nbsp;and if you haven&apos;t heard of it, you should check it out. In short, it gives you a &lt;abbr title=&quot;Command Link Interface&quot;&gt;CLI&lt;/abbr&gt; for WordPress. Throughout the script, various tasks are completed using the CLI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tasks Completed:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Activate plugins and theme&lt;/li&gt;
&lt;li&gt;Create a primary menu (Main Menu)&lt;/li&gt;
&lt;li&gt;Create a &quot;Home&quot; page and set it to the front page&lt;/li&gt;
&lt;li&gt;Create additional pages (the user is prompted to input a comma separated list of pages)&lt;/li&gt;
&lt;li&gt;Create a &quot;Blog&quot; page and set it to the page for posts&lt;/li&gt;
&lt;li&gt;Update rewrite structure and timezone&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;h2 id=&quot;theresult&quot;&gt;THE RESULT:&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Where does this leave us?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We can now set up a new WordPress site with only a few keystrokes!&amp;nbsp;This is amazing news. A task that use to take us anywhere from 15 - 30 minutes, now only takes us around 5 minutes. With all that extra time, you could easily get through another HM blog post!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://kylebrumm.com/media/posts/mind-blown.gif&quot; alt=&quot;Mind Blown&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Where do we go from here?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Obviously this script isn&apos;t going to fit into everybody&apos;s workflow perfectly, but I&apos;m sure there are pieces that can be extracted and used on their own in a lot of cases. Finding that perfect setup is like finding a unicorn. Although there are always going to be ways to improve, hopefully this will at least help you head in that direction. &amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;h2 id=&quot;tldr&quot;&gt;TL;DR:&lt;/h2&gt;

&lt;p&gt;Setting up a new WordPress site takes way too long, and there are too many things to remember to do. This script solves that problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What this&amp;nbsp;script will do:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clone the latest version of WordPress&lt;/li&gt;
&lt;li&gt;Update the configuration files with the project slug&lt;/li&gt;
&lt;li&gt;Create a local database&lt;/li&gt;
&lt;li&gt;Install Ruby dependencies&lt;/li&gt;
&lt;li&gt;Set up WordPress locally&lt;/li&gt;
&lt;li&gt;Create a BitBucket repository using the project slug&lt;/li&gt;
&lt;li&gt;Add your deployment keys to the new repository&lt;/li&gt;
&lt;li&gt;Create a new ServerPilot application&lt;/li&gt;
&lt;li&gt;Create a new database for the application (randomly generated username and password)&lt;/li&gt;
&lt;li&gt;Update the database.yml with the database credentials&lt;/li&gt;
&lt;li&gt;Clone the needed plugins and themes&lt;/li&gt;
&lt;li&gt;Update the Gruntfile with our project slug&lt;/li&gt;
&lt;li&gt;Install NPM packages&lt;/li&gt;
&lt;li&gt;Run the initial Grunt task&lt;/li&gt;
&lt;li&gt;Activate plugins and theme&lt;/li&gt;
&lt;li&gt;Create a primary menu (Main Menu)&lt;/li&gt;
&lt;li&gt;Create a &quot;Home&quot; page and set it to the front page&lt;/li&gt;
&lt;li&gt;Create additional pages (the user is prompted to input a comma separated list of pages)&lt;/li&gt;
&lt;li&gt;Create a &quot;Blog&quot; page and set it to the page for posts&lt;/li&gt;
&lt;li&gt;Update rewrite structure and timezone&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think you have a better WordPress setup? Let me know in the comments. I&apos;m always looking for ways to improve the way we do things here.&lt;/p&gt;

&lt;p&gt;Feel free to head over to&amp;nbsp;Github&amp;nbsp;and grab &lt;a href=&quot;https://gist.github.com/kjbrum/04a243995c3334edbd23&quot;&gt;the script&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Fri, 31 Jul 2015 00:00:00 +0000</pubDate>
        <link>https://kylebrumm.com/the-ultimate-wordpress-setup</link>
        <guid isPermaLink="true">https://kylebrumm.com/the-ultimate-wordpress-setup</guid>
        
        
        <category>Tips &amp; Tricks</category>
        
        <category>WordPress</category>
        
      </item>
    
      <item>
        <title>Smooth Scrolling to Elements with JavaScript</title>
        <description>&lt;p&gt;I always find myself searching for this little snippet on Google, so I decided it was about time I save it so it’s easier to find from now on.&lt;/p&gt;

&lt;p&gt;This will make every anchor tag on your site that has an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;href=&quot;#&quot;&lt;/code&gt; scroll smoothly to the desired element.&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/kjbrum/12be2a913b987d206f23.js&quot;&gt;&lt;/script&gt;

</description>
        <pubDate>Mon, 13 Jul 2015 00:00:00 +0000</pubDate>
        <link>https://kylebrumm.com/smooth-scrolling-to-elements-with-javascript</link>
        <guid isPermaLink="true">https://kylebrumm.com/smooth-scrolling-to-elements-with-javascript</guid>
        
        
        <category>Snippets</category>
        
        <category>JavaScript</category>
        
      </item>
    
      <item>
        <title>Using the First Paragraph as an Excerpt</title>
        <description>&lt;p&gt;Excerpts aren’t very flexible out of the box with WordPress. That’s why I came up with this nice function for getting the first paragraph of the post content. This makes it so that you don’t have any excerpts that just get randomly cut off in the middle of a sentence.&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/kjbrum/8f455fa285607dabbcf5.js&quot;&gt;&lt;/script&gt;

</description>
        <pubDate>Thu, 09 Jul 2015 00:00:00 +0000</pubDate>
        <link>https://kylebrumm.com/using-the-first-paragraph-as-an-excerpt</link>
        <guid isPermaLink="true">https://kylebrumm.com/using-the-first-paragraph-as-an-excerpt</guid>
        
        
        <category>Snippets</category>
        
        <category>WordPress</category>
        
      </item>
    
      <item>
        <title>Cleaning a String in PHP</title>
        <description>&lt;p&gt;It’s not uncommon to use a post title as an identifier for some functionality. This function will clean up the supplied string and return a nicely formatted one.
In short, it removes any whitespace, replaces spaces with hyphens, removes non-alphanumeric characters, and makes everything lowercase.&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/kjbrum/2fe7ae874bb0547d1e8a.js&quot;&gt;&lt;/script&gt;

</description>
        <pubDate>Mon, 06 Jul 2015 00:00:00 +0000</pubDate>
        <link>https://kylebrumm.com/cleaning-a-string-in-php</link>
        <guid isPermaLink="true">https://kylebrumm.com/cleaning-a-string-in-php</guid>
        
        
        <category>Snippets</category>
        
        <category>PHP</category>
        
      </item>
    
      <item>
        <title>6 Web Development Tools to Increase Your Efficiency</title>
        <description>&lt;p&gt;&lt;img src=&quot;https://kylebrumm.com/media/posts/web-development-tools.png&quot; alt=&quot;6 Web Development Tools to Increase Your Efficiency&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As a web developer, I can&apos;t stand doing things inefficiently. There are so many development, design, or just everyday tasks that we do throughout the day, that can be done more efficiently. There&apos;s even a chance that the task can be automated to take most of the leg work out out of it. That&apos;s why I like web development tools so much. If you&apos;re like me, you like getting things done so you can spend more time with friends and family, or just browsing &lt;a href=&quot;http://www.reddit.com/&quot;&gt;reddit&lt;/a&gt; and &lt;a href=&quot;http://imgur.com/&quot;&gt;imgur&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;There is an endless amount of applications out there that will help you be more efficient and productive, in fact,&amp;nbsp;&lt;a href=&quot;https://itsahappymedium.com/blog/latest-news/6-approved-apps-approaching-productivity/&quot;&gt;Andrew covered some of these&lt;/a&gt; a few months&amp;nbsp;back. Not only are these great for web development, but they can help with everyday tasks as well.&lt;/p&gt;

&lt;h3 id=&quot;alfredhttpwwwalfredappcom_maconly_&quot;&gt;&lt;a href=&quot;http://www.alfredapp.com/&quot;&gt;ALFRED&lt;/a&gt; - &lt;em&gt;Mac Only&lt;/em&gt;&lt;/h3&gt;

&lt;p&gt;Alfred is an amazing application and you can do any number of things with it. In order to unlock its full potential, you have to purchase the &lt;a href=&quot;https://buy.alfredapp.com/&quot;&gt;Powerpack&lt;/a&gt;. Let me tell you, it is well worth it. Once you have the Powerpack, you can download or even create your own &quot;workflows.&quot; Another amazing use is the &quot;&lt;a href=&quot;http://support.alfredapp.com/kb:spell&quot;&gt;spell&lt;/a&gt;&quot; command. In fact, I used it 8 times while writing this article! A few of my favorites workflows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://wemakeawesomesh.it/alfred-dev-doctor/&quot;&gt;Dev Doctor&lt;/a&gt; - Specifically the &quot;caniuse&quot; command which allows you to search &lt;a href=&quot;http://caniuse.com/&quot;&gt;caniuse.com&lt;/a&gt;. (For when you need to check if something doesn&apos;t work in &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.packal.org/workflow/colors&quot;&gt;Colors&lt;/a&gt; - Lets&amp;nbsp;you easily convert colors from one format to another. (i.e. Hex to RGB)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/kjbrum/alfred-workflows/blob/master/Hipsum.alfredworkflow&quot;&gt;Hipsum&lt;/a&gt; - Grabs&amp;nbsp;dummy text using the &lt;a href=&quot;http://hipsum.co/&quot;&gt;hipsum.co&lt;/a&gt; &lt;abbr title=&quot;Application Programming Interface&quot;&gt;API&lt;/abbr&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/kjbrum/alfred-workflows/blob/master/Reddit.alfredworkflow&quot;&gt;Reddit&lt;/a&gt;&amp;nbsp;- Puts the top posts of &lt;a href=&quot;http://reddit.com&quot;&gt;reddit.com&lt;/a&gt; at your fingertips.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to check out all my &lt;a href=&quot;https://github.com/kjbrum/alfred-workflows&quot;&gt;personal workflows on Github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.alfredapp.com/&quot;&gt;
    &lt;img src=&quot;https://kylebrumm.com/media/posts/alfred-colors.png&quot; alt=&quot;Alfred Colors&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;spectaclehttpspectacleappcom_maconly_&quot;&gt;&lt;a href=&quot;http://spectacleapp.com/&quot;&gt;SPECTACLE&lt;/a&gt; - &lt;em&gt;Mac Only&lt;/em&gt;&lt;/h3&gt;

&lt;p&gt;Do you ever find yourself struggling to move and organize all your windows? Spectacle can fix that! With Spectacle, you will be able to easily arrange your windows with minimal&amp;nbsp;effort. It&apos;s as simple as &lt;em&gt;Command +&lt;/em&gt; &lt;em&gt;Option&lt;/em&gt; &lt;em&gt;+ Right Arrow&lt;/em&gt;. Your window is now covering the right half of your screen.&amp;nbsp;BOOM! The shortcuts are easily customizable, and&amp;nbsp;better yet, the project is &lt;a href=&quot;https://github.com/eczarny/spectacle&quot;&gt;open source&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://spectacleapp.com/&quot;&gt;
    &lt;img src=&quot;https://kylebrumm.com/media/posts/spectacle.png&quot; alt=&quot;Spectacle&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;flycuthttpsgithubcomtermitflycut_maconly_&quot;&gt;&lt;a href=&quot;https://github.com/TermiT/Flycut&quot;&gt;FLYCUT&lt;/a&gt; - &lt;em&gt;Mac Only&lt;/em&gt;&lt;/h3&gt;

&lt;p&gt;Holy smokes! If you have ever had to enter copy into a website, you know how&amp;nbsp;tedious of a task it can be. Constantly going back and forth between the website and the copy document, copying paragraph by paragraph. That&apos;s just silly, don&apos;t do that! Flycut basically creates a &quot;clipboard history&quot; for you. This means that you can copy multiple chunks of text, and then paste them one by one with &lt;em&gt;Shift + Command + V&lt;/em&gt;. You can even sync your clipboard between computers using Dropbox. Again, Flycut is an open source project&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/TermiT/Flycut&quot;&gt;
    &lt;img src=&quot;https://kylebrumm.com/media/posts/flycut.png&quot; alt=&quot;Flycut&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;h2 id=&quot;tools&quot;&gt;Tools&lt;/h2&gt;

&lt;p&gt;If you are a web developer, you have probably noticed the&amp;nbsp;plethora of tools that have been sprouting up in the past couple of years. It is amazing to have so many great tools at our disposal, but it can be very&amp;nbsp;difficult deciding what tools are really worth keeping around. I certainly haven&apos;t tried them all, but these are a few of my favorite.&lt;/p&gt;

&lt;h3 id=&quot;buildtools&quot;&gt;Build Tools&lt;/h3&gt;

&lt;p&gt;If you do a lot of front end development, I&apos;m sure you are familiar with the large number of tedious tasks&amp;nbsp;that constantly need doing when making &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt;&amp;nbsp;or&amp;nbsp;&lt;abbr title=&quot;JavaScript&quot;&gt;JS&lt;/abbr&gt; changes. If you keep up with popular&amp;nbsp;web development tools and trends, there&amp;nbsp;is a high probability that you have heard of one of the many build tools out there, including &lt;a href=&quot;http://gruntjs.com/&quot;&gt;Grunt&lt;/a&gt;, &lt;a href=&quot;http://gulpjs.com/&quot;&gt;Gulp&lt;/a&gt;, and &lt;a href=&quot;http://brunch.io/&quot;&gt;Brunch&lt;/a&gt;. Build tools are used to automate tasks, such as compiling Sass, minifying JS files, and compressing images. I have given&amp;nbsp;both&amp;nbsp;Grunt and Gulp a chance at proving themselves. They both have their pros and cons, but since starting at Happy Medium, Grunt has&amp;nbsp;definitely taken the lead after using it on a day-to-day basis. Grunt has a much&amp;nbsp;larger community, which in return, means that more plugins are created for it. If you don&apos;t currently use a build tool, I highly suggest giving them all a try and finding out which works best for you; they will completely change your workflow. Build tools with a &lt;abbr title=&quot;Graphical User Interface&quot;&gt;GUI&lt;/abbr&gt;: &lt;a href=&quot;https://incident57.com/codekit/&quot;&gt;CodeKit&lt;/a&gt; (Mac) &amp;amp; &lt;a href=&quot;https://prepros.io/&quot;&gt;Prepros&lt;/a&gt; (Windows)&lt;/p&gt;

&lt;p&gt;&lt;a style=&quot;float: left&quot; href=&quot;http://gruntjs.com&quot;&gt;&lt;img src=&quot;https://kylebrumm.com/media/posts/grunt.png&quot; alt=&quot;Grunt&quot; /&gt;&lt;/a&gt;&lt;a style=&quot;float: left; padding-left: 50px&quot; href=&quot;http://gulpjs.com&quot;&gt;&lt;img src=&quot;https://kylebrumm.com/media/posts/gulp.png&quot; alt=&quot;Gulp&quot; /&gt;&lt;/a&gt;&lt;a style=&quot;float: left; padding-left: 50px;&quot; href=&quot;http://brunch.io&quot;&gt;&lt;img src=&quot;https://kylebrumm.com/media/posts/brunch.png&quot; alt=&quot;Brunch&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;browsersynchttpwwwbrowsersyncio&quot;&gt;&lt;a href=&quot;http://www.browsersync.io/&quot;&gt;BROWSERSYNC&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;BrowserSync is another great tool for front end development. Again, I&apos;m sure you are familiar with how tedious it can be when working with CSS and JS. For example, you make a change to your stylesheet, save the changes, and then have to go back and refresh your browser window so the changes will appear. There is no need for that - let BrowserSync help you out. A few things you get with BrowserSync:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File syncing - the browser will automatically update when you make changes to your files&lt;/li&gt;
&lt;li&gt;Remote Inspection - Inspect a browser on any device, remotely&lt;/li&gt;
&lt;li&gt;URL Tunneling - Share your local sites with everyone&lt;/li&gt;
&lt;li&gt;Interaction Sync - Any interactions you perform (click, scroll, etc...), are mirrored&amp;nbsp;between your browsers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;BrowserSync has&amp;nbsp;a &lt;abbr title=&quot;Command Line Interface&quot;&gt;CLI&lt;/abbr&gt; or you can integrate it into your workflow with &lt;a href=&quot;http://www.browsersync.io/docs/grunt/&quot;&gt;Grunt&lt;/a&gt; or &lt;a href=&quot;http://www.browsersync.io/docs/gulp/&quot;&gt;Gulp&lt;/a&gt;. If you combine BrowserSync and Grunt a typical workflow might&amp;nbsp;look something like this.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the terminal, navigate to your project directory, and run &amp;nbsp;&lt;code&gt;$ grunt bs.&amp;nbsp;&lt;/code&gt;This will start the BrowserSync task, which will watch for changes made to your project files.  &lt;/li&gt;
&lt;li&gt;When you&amp;nbsp;make a change to a Sass&amp;nbsp;file, Grunt will see the change, run that task to compile your Sass files, and then BrowserSync will update your browser accordingly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href=&quot;http://www.browsersync.io/&quot;&gt;
    &lt;img src=&quot;https://kylebrumm.com/media/posts/browsersync.png&quot; alt=&quot;BrowserSync&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;wpclihttpwpcliorg&quot;&gt;&lt;a href=&quot;http://wp-cli.org/&quot;&gt;WP-CLI&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;If you are a WordPress developer, WP-CLI is a must have. WP-CLI is, you guessed it, a command line tool for performing WordPress tasks. Commands range from scaffolding&amp;nbsp;a new plugin to flushing the rewrite rules, if it&apos;s something you can do in the admin area, it can probably be done with the CLI. If you want to fully harness the power of WP-CLI, you could write a Bash script to help you set up a new project with just a few commands. I&apos;ve actually been working on my own&amp;nbsp;setup script that&amp;nbsp;you can &lt;a href=&quot;https://github.com/kjbrum/wp-setup-script&quot;&gt;check it out on Github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://wp-cli.org/&quot;&gt;
    &lt;img src=&quot;https://kylebrumm.com/media/posts/wp-cli.png&quot; alt=&quot;WP-CLI&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;h2 id=&quot;honorablementions&quot;&gt;Honorable Mentions&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://sass-lang.com/&quot;&gt;Sass&lt;/a&gt;&amp;nbsp;- CSS&amp;nbsp;preprocessor&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://bower.io/&quot;&gt;Bower&lt;/a&gt; - A package manager for the web&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.npmjs.com/&quot;&gt;NPM&lt;/a&gt; - Node Package Manager&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://brew.sh/&quot;&gt;Homebrew&lt;/a&gt; - The missing package manager for OS X&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://capistranorb.com/&quot;&gt;Capistrano&lt;/a&gt; - Remote server automation and deployment tool&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the end of the day, it doesn&apos;t really matter what you use to help you get the job done. Just remember to always keep improving the way you do things and that it&apos;s likely&amp;nbsp;you can change the way you do something each day to be more efficient. Have you heard of all these&amp;nbsp;applications and tools before? What applications and tools do you use that help you be more efficient? Have a workflow you think I could use? I&apos;m always looking for new ways to automate and save time. Leave your comments below!&lt;/p&gt;
</description>
        <pubDate>Wed, 20 May 2015 00:00:00 +0000</pubDate>
        <link>https://kylebrumm.com/6-web-development-tools-to-increase-your-efficiency</link>
        <guid isPermaLink="true">https://kylebrumm.com/6-web-development-tools-to-increase-your-efficiency</guid>
        
        
        <category>Tips &amp; Tricks</category>
        
        <category>Misc</category>
        
      </item>
    
      <item>
        <title>Sorting Arrays by Key Value</title>
        <description>&lt;p&gt;I can’t remember where this came in handy, but I know I needed it at some point. This snippet does exactly what it says, sorts a JavaScript array by the supplied key value.&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/kjbrum/8591343d83598dc53ef1.js&quot;&gt;&lt;/script&gt;

</description>
        <pubDate>Thu, 09 Apr 2015 00:00:00 +0000</pubDate>
        <link>https://kylebrumm.com/sorting-arrays-by-key-value</link>
        <guid isPermaLink="true">https://kylebrumm.com/sorting-arrays-by-key-value</guid>
        
        
        <category>Snippets</category>
        
        <category>JavaScript</category>
        
      </item>
    
  </channel>
</rss>
