The Mijingo Blog

Latest news, updates, free tutorials, and more from Mijingo.

Installing Sublime Text Package Control

by Ryan Irelan

Installing packages (add-on functionality that isn't core to the Sublime Text application) in Sublime Text is faster using the Package Control tool.

Package Control isn't part of Sublime Text but an independent project that makes adding additional functionality to Sublime Text easier. If you like Package Control and find yourself depending on it for your work, consider saying thanks to the developer with a small donation to help cover server costs.

To install Package Control on Sublime Text 3, you need input a series of commands into the Sublime Text console. This is actually a Python console but for our needs we just need to paste in a series of commands and Sublime Text will take care of the rest.

Get the Python Code

From the Package Control installation instructions, we grab the Python code to install Package Control. Get the latest version from the site (I could past it here but the code changes with each release and I want to make sure you have the latest code).

Run the Code

To kick of the installation, we run the code in the Sublime Text console.

  1. Type `control-`` to open the console in the bottom portion of the Sublime Text application window.
  2. Paste in the code and press enter.
  3. Once complete and successful, restart Sublime Text.

Type shift-command-p to open the command palate and type:

package control

If you see options for Package Control (like Package Control: Install Package) then Package is properly installed.

Sometimes the tool doesn't install properly. If this happens to you, use the manual installation instructions instead.

Pick Your Tools and Use Them

by Ryan Irelan

From a recent Twitter series I shared:

Not everyone likes Sass or wants to use Grunt or even likes a CMS. That’s okay. If the tools help you, use them.

Sublime Text Tips and Plugins

by Ryan Irelan

Magnus Gyllenswärd of Thoughtbot did a short overview of some of the features and plugins he uses and likes in Sublime Text as part of his Thoughtbot Lunchtime Lightning presentation.


Here are some of the things he covers:

  • Fetch - fetch remote files from anywhere
  • Gist from condemil, create and edit Gists.
  • Less Tabs from Web Artisan. Remove tabs that you haven’t used in a while.
  • Emmet - Official plugin for Sublime Text for writing markup faster.
  • Multiple cursors - a flagship feature of Sublime Text. Memorize this if you don’t know it already.
  • Sublime Text Projects - a feature I don’t really use but probably should!
  • Can I Use plugin, that lets you highlight a property and see its support on caniuse.com.

By the way, if your company doesn’t do lunch time talks where you share information and techniques internally, I strongly encourage it. Whether you call them Lunchtime Lightning talks, Lunch ‘n’ Learns—as they were at my previous company—or no name at all, these gatherings are a way to rapidly transfer knowledge among team members. Very valuable!

(Link via Gabe at Macdrifter)

Git Aliases in .bash_profile

by Ryan Irelan

Learn how to add system-wide Git aliases to your .bash_profile that allow you to:

  • create a shortcut to quickly push changes to the develop branch of your project
  • quickly push to the master branch using a bash alias
  • stage a boatload of files (added and deleted) with one five-letter command. This is perfect to large updates to CMSes, frameworks, and web apps.

This 7 minute video is an excerpt from the OS X Shell Tricks course.

Find Out What A Command Does

by Ryan Irelan

In the command line, you’ll often find yourself wondering exactly what some command does, what the options are, and how, just maybe, you can make your use of that command even better. Here’s how to do it.

The first place I always look when needing more information about the command is the manual (or man as the cool kids might refer to it). Most well-maintained and well-documented tools will have robust manual pages for you to review.

Let’s say we need to know more about git-reset, a tool in Git that allows you to (destructively) rollback changes to your repository.

I know the command is git reset and if add the --help option to it, I’ll get the manual for git-reset.

git reset --help

In the case of git-reset, we get a healthy amount of well-written documentation and very, very helpful Examples area. The examples provided offer real-world scenarios you might face, right from the folks who are working on the Git source code.

Manual for git-reset

Another way to get help with a command is to use the man command:

man ssh

This will display the manual for the SSH command (note that ssh --help does not work).

Not every tool has as robust a manual as Git and SSH but most all do, and you can learn a lot from them. Next time you get stuck, check out the manual!

Want to learn more about the command line? Our Command Line Fundamentals course will get you started on the path to success.

Bash Alias to Download and Extract Latest WordPress

by Ryan Irelan

In the last blog post we covered the basics of bash aliases and how to create one. This time I want to jump back into Greg’s Command Line Fundamentals course and share a nice trick on how to automate downloading and extracting the latest version of WordPress.

This is an alias we could use just about every single day.

I have an empty directory on my computer called new-wp. I want to create an alias that will:

  1. Download the latest WordPress via wget
  2. Unarchive the download using tar
  3. Clean up by deleting the downloaded archive.

Here’s what the alias would look like:

alias get_wp="wget http://wordpress.org/latest.tar.gz && tar zxvf latest.tar.gz && rm latest.tar.gz"

The first part is using the alias keyword to start defining a new alias, followed by the name of the alias. In this example we’ll call it get_wp.

Then we define the commands, starting with wget, fetching the latest.tar.gz file on the WordPress server, which always contains the latest version of the software.

We use the && operator to tell Bash to run an additional command (but only when/if the first one completes). The second command is to unarchive the file using tar.

Finally, we add another && operator to remove and bash the downloaded archive. Since we’ve already unarchived it, we no longer need it around.

Now run the command inside the new-wp directory

get_wp

and see the magic happen!

If you prefer to watch instead of read, check out this excerpt of the same tutorial from Greg Aker’s Command Line Fundamentals course:

Creating Bash Aliases

by Ryan Irelan

Bash aliases allow you to set a shortcut command for a longer command. For example, you could set the command cc to be a shortcut for the clear command. cc + Enter is much faster to type than clear.

Aliases are defined in the .bash_profile or .bashrc file (typically in your user home directory).

A bash alias has the following structure:

alias [alias_name]="[command_to_alias]"

A new alias always starts on a new line with the alias keyword. You define the shortcut command you want to use with the alias name, followed by an equal sign. In quote, you type the full command you want to run.

A popular example is customizing the ls command for listing directories and files. Instead of typing out

ls -lhaG

We can just shorten that to ll. Here’s the alias to do that:

alias ll="ls -lhaG"

Put that in your .bash_profile or .bashrc file and then open a new Terminal window or reload using:

source ~/.bash_profile

Now, type ll and you should see the full command run.

Here’s a video excerpt from our Command Line Fundamentals how-to video that covers the basic of bash aliases.


Want to learn the basics of navigating around the command line? Watch our Command Line Fundamentals course.

Adding to Your System Path

by Ryan Irelan

The System Path is a special environment variable in your command line session that references the full file system path to the location of binaries and executables (command line applications).

What follows assumes you’re using Bash and may be OS X biased.

It is typically located in your user home directory inside of a hidden file called .bash_profile or .bash_rc (here’s a good comparison of the two files. Most of the time you’ll use .bash_profile.

Basically, the System Path lets you cheat at the command line by only typing the command name and not the exact location of it.

Knowing about the System Path is important because as you get more experience working on the command line you may have to install software that will require you to update your system path in order to run the software from the command line without specifying the full path.

As an example, I run the git command dozens of time per day. But I just run git and nothing else. My system knows where to find the location of the Git binary (the Git application itself) because the location is listed in my System Path.

The actual location of git is /usr/bin/. If I ran /usr/bin/git it’s the same thing as if I ran only git.

But my System Path doesn’t know explicitly about Git. It has a set of paths (full locations to directories) that it checks each time I run a command. If there are 3 paths set, my Terminal session will check each one until it finds the location of Git.

To add to, edit, or just view your System Path, you’ll need to access the .bash_profile. I like to do this using vim.

It’s okay, I know. Sounds scary. But I’ll walk you through it. We start by opening up the .bash_profile in Vim.

vim ~/.bash_profile

The .bash_profile file is located in the user home directory. We use the tilde as shortcut for that. Once that’s open you should see something like this near the top:

export PATH=/usr/local/bin:~/bin:$PATH

This your System Path. It has two paths defined to check when we run a command. Let’s add another path to it.

In order to edit the file in Vim, we’ll need to go into insert mode. Press the “i” key. Then use your arrow keys to navigate to the end of the export statement. Type in the path you need to add.

Mine is going to look like this:

export PATH=/usr/local/bin:~/bin:/Applications/Inkscape.app/Contents/Resources/bin:$PATH

We added a colon and then the path to the Inkscape binary for the command line tool (see more about using that). The path is an absolute, full path right to the directory that contains the binary.

After you’re done editing, hit the Escape key (or control-c) and then type :wq for write and quit. You should be dropped back into the command line prompt.

Before the current terminal session knows about the changes we’ve made, we need to reload our .bash_profile. We can do that by opening a new Terminal window or running:

source ~/.bash_profile

Now let’s test out the change: inkscape (whatever command you need to run will probably be different).

Ready to learn more about the command line? Our Command Line Fundamentals course will get you up and running in no time.

OS X Shell Tricks: Get more from your Mac

by Ryan Irelan

Brett Terpstra is one of the best minds when it comes to improving how you use your Mac. He’s been authoring tools and scripts for years that thousands and thousands of people rely on every day.

Now you can learn Brett’s tricks in our latest course: OS X Shell Tricks.

I’m really happy to have OS X Shell Tricks available today and, I’ll be honest, I learned a ton while preparing to teach the course. It’s really, really good.

Take Command of the Command Line

After watching this course you’ll be better prepared to take command at the command line. You will learn about a dozen different tricks for saving time and doing more. Along the way you’ll also learn some tactics to put together your own tricks.

The course covers the following:

  • Files & Directories – where we will dive deep in to the open command, learn how to quick look files from the command line, batch change file extensions, and move from the Finder to the Terminal seamlessly.
  • Git Shell Tricks - we will look at using git aliases, editing our gitconfig file, searching through git aliases, and creating Github Gists from the command line.
  • Tricks for Web Designers - We’ll get image dimensions in the command line, batch process images using sips, and create base64 version of images, including scripting it so we can quickly create a CSS background property from an image.
  • Wrapping Up - Then we’ll wrap up by learning how to make the command line manuals even easier to access as PDFs and tips for branching out and getting even better at the command line.


Ready to go? Get started learning some great OS X shell tricks

Learn the Command Line

by Ryan Irelan

At the beginning of our latest course, Command Line Fundamentals, Greg Aker shared a story about the time he was first required to interact with a server via the command line. And he was terrified because he didn’t have the basics he needed.

That was years ago and now Greg, a wizard at command line and server admin, wants you to be prepared (the way he wasn’t).

You can learn what you need to know to get started on the command line with Greg’s Command Line Fundamentals course. It’s available now.

The course starts off by getting familiar with the command line and then jumps in to working with files and directories, searching, archiving, setting permissions, connecting to remote servers, and more.

Here’s Greg introducing the course:


Ready to learn the command line? Get started today

What are our customers saying?


"Just purchased your Flexible Twig course. Love it!"
Tyler Morrison
"Been enjoying @mijingo 's Learning Craft video tutorials. Feeling like I've got a good basic understanding of #craftcms Very impressive"
Laura Montgomery
"I bought your Craft Starter Pack a year and a half ago. Worth every dollar. In fact, I would've paid twice as much for it, because you saved me so much time."
Timothy Ingram
"Ben's knowledge of Craft combined with his relaxed and informal teaching style makes for a great learning experience."
Steve Abraham
"Ben puts a lot of thought into his teaching approach and has the ability to explain complex concepts in a way that just make sense"
Gareth Redfern
"Ben is great at taking a complex subject and breaking it down in a way that you can wrap your mind around. I thought that plugin development was something I would never understand, and happily Ben proved me wrong!"
Jonathan Melville
"I really appreciate all the videos and writing you have done. Your work has given me a jump start on my front end development business."
Shan Ricciardi

Perfect for Small Teams & Companies


Mijingo's courses are perfect as the training curriculum for both small teams and entire companies.

Our courses are offered in Team Packs (up to 5 people) and Company Packs (up to 25 people), so you can make one simple, fast purchase to train your entire staff.

Prices are listed with each course. Need more than 25 or something custom?

Send Your Requirements
Team Pack2-5 People
Company Pack6-25 People
Custom Pack25+ People