What’s the Difference Between jQuery’s document.ready() and window.load()?

If you’ve used any jQuery plugins in your time – and lord knows I used to live on jQuery plugins – then you’ve probably seen the example code tell you to wrap your plugin calls in a $(document).ready() or $(window).load() but do you know what they are or how they’re different? Most people are very familiar with $(document).ready() but not a lot of love is given to $(window).load. If you’re trying to understand how jQuery works and move beyond the copy-paste mentality that many new JavaScript developers start off with, here’s a quick but thorough explanation of these functions and how to use them.

Read on

Terminal Tricks That Will Change Your Life

When I first started using the terminal for development it was a strange and awkward thing for me. I couldn’t stop thinking that having a GUI application to run the tasks I was trying to complete was superior and easier. Now, five years later, GUI apps get in my way more than help. GUI apps have become cumbersome to use while the terminal seems natural. If you’ve never used the terminal much in development or you’re just getting into it, here are some tricks I’ve learned that’ll change the way you do things forever.

Read on

Should I Load Google Web Fonts JS API or the CSS Link?

I was checking out the source of a site that used some Google Web Fonts today and noticed they were loading them through the JavaScript FontLoadewr script. Being ever the curious one I began to wonder what the benefits were and if they were worth it. In the process I learned some new tricks to help with site performance and formed some strong opinions on how I won’t be using Google Web Fonts.

Read on

Apache 2.4 and 500 Errors in Htaccess

I upgraded my main server from Ubuntu 12.04 to 14.04 yesterday and after the upgrade Apache didn’t want to serve anything but 500 errors. Turns out that Ubuntu 14.04 brings with it an upgrade to Apache 2.4 (used to be 2.2). One of many issues were errors stemming from .htaccess files. Here’s how to fix those.

Read on

Backup and Restore a MySQL Database

Web hosting is cheap and expensive. Cheap because you can get a small VPS on DigitalOcean for $5 a month and expensive because when you use a VPS you either need to spend time or money to keep essential services like email running. I’m in the process of moving some sites off of MediaTemple and on to Linode and DigitalOcean to save some money. Part of the process requires moving databases around. So, for my own personal future reference and anyone else who may want to bookmark a refresher, here’s how to backup and restore a MySQL database and move it between hosts.

Read on

Quick and Dirty Option Parsing in Node (or Why Eval() Is Not Evil)

My latest project is broken up into a Ruby core (for the server) and a number of front-end modules for things like themes and dashboard design. I needed a way for developers working on the front-end modules (which are structured as Node/npm compatible packages) to be able to install the built files into the core project. Grunt tasks only work in their root directory and the complexity of the tasks called for something that could be extracted out of the projects and be reuseable. So I’m writing a Node CLI utility. The first problem that needed to be solved was option parsing. This is a story of the state of option parsers in Node, how to write one yourself, and why “eval() is evil” is misunderstood.

Read on

∞ How Novices Debug Code

A few months ago I debugged a real hairy issue involving dependencies on different machines running the same cloned git repository. I had begun to write a real lengthy post on how novices debug code vs. how experienced programmers do it. Today I came across this article that explains it much better than I ever could. You should check it out. My thoughts on it are after the jump.

Read on

Sublime Text Keyboard Shortcuts

I’ve been using the amazing Sublime Text editor since it came out a few years ago and ended up learning all it’s neat shortcuts almost by accident. Today I want to share all of them. They’ll be here for me to reference and for anyone else who wants a quick and easy reference for Sublime Text shortcuts they don’t know and may want to take advantage of one day. All credit goes to the Sublime Text Unnoficial Documentation for this.

Read on

From IDE to Plain Text Editor

Clients, friends, acquaintances, and hobbyist developers will often ask me “what program” do you use to make websites. No matter how many times I hear the question I’m always taken back. I don’t know how to answer that question. Inevitably, each time I respond in an annoyed/confused tone “What do you mean”? Professionals talking amongst themselves will speak about IDE’s, text editors, terminal emulators, and other specifics, each of which are actually far simpler tools than the one that the less skilled are hoping you’ll tell them is the best. So how is that we go from complex IDE’s like Dreamweaver to simpler tools like text editors as we get better at our craft?

Read on

Random Issues on OS X After Installing Xcode

Ever had some strange things happen on the Mac command line? Have you installed or updated Xcode recently? The issue is most likely related to the command line tools. Before you tear your hair out, make sure you check these possible solutions first.

Read on