Configuring Sublime Text 2

Howdy folks, check out my blog on configuring Sublime Text 2 over on the Mutually Human blog. I will probably do the vast majority of my technical blogging on the MHS site, but I may occasionally drop a line on here too.

Understand Your True $PATH

I recently took some time to actually understand what the hell was going on in my terminal config file (I use ZSH, but this post should apply to BASH as well). The thing that pushed me over the edge was that I was running into a situation where I had different versions of git that were being used in different situations. I was working on an Adobe Air app that was somehow using my system git, instead of the one I installed via Homebrew. I tracked the problem down to my PATH and then realized that I didn't fully understand the whole PATH thing as well as I should.

So I opened up my config and my PATH variable looked like a super long unintelligible mess (I wish I had saved a version of it for comparison). I had followed too many tutorials/installation instructions that simply told me to "copy and paste this code into terminal" and it resulted in a ton of things appending to my PATH. There were a lot of words and slashes and it was not clear to me the order in which things were loaded. So I decided to separate each individual path that was being added to my PATH, and put each one on a separate line. This really makes it clear the order in which things load, so that it is clear that things being installed from brew (/usr/local/bin) run before macports or system.

*Update*: I bought a new computer and cleaned out my PATH even more, getting rid of macports etc.

Let me know in comments if you have any questions, or suggestions for improvement.

CoffeeScript jQuery Animated Scrolling Sidebar

I have been really getting into writing CoffeeScript lately, so I decided to revisit the jQuery floating sidebar I blogged about a while back. The logic is the same, other than using a named function to increase readability. The code is shrunk from 40 lines to 28 lines (with extra line breaks for readability). More importantly, I believe the code is easier to understand.

The basic concept is to create function which I have called jitteryScroll that either scrolls the sidebar items, or returns them to the header if the scroll is at the top of the page. Then I define a function that fires on scroll and I use setTimeout in order to prevent the scroll function from overloading the browser (the scroll function fires like a machine gun when a user scrolls a page).

Let me know if you have any questions or suggestions.

Alfred AppleScript to Toggle Mono Stereo Audio Output

A huge pet peeve of mine is hearing only one channel of stereo music. However, sometimes I want to only put one earbud in my ear so that I can hear what is going on around me while working. So I devised a quick little AppleScript / Alfred Extension to toggle the output for when I switch from mono (one earbud) to stereo (both buds in, rocking out) and vice versa. Really, I just found this AppleScript, added the alfred wrapper, and added Growl support.

Pages

Subscribe to Front page feed