January 2012
1 post
2 tags
iTunes Sleep Timer
Here is a simple AppleScript that will smoothly fade out your music and then pause iTunes and optionally sleep your Mac. There are a few nice things about this script: Lets you choose to sleep the machine or not at the end. Puts iTunes back to its original volume after pausing it at the end. Waits half of the time before starting the gradual fade, so you can enjoy the music at normal volume...
Jan 30th
June 2011
1 post
2 tags
Mercurial: How to reapply a revision/changeset
Sometimes you have to collaborate with someone who doesn’t use version control. This will happen often if you’re sharing work over ftp. If you make a change and then receive an old version of the file you changed with a new change of theirs, you can reapply your change with this command. Let’s assume your change is in revision 78 and in file my/awesome/file.js Go to the...
Jun 9th
4 notes
March 2011
1 post
2 tags
Dynamic Tweet Button Text Using jQuery
I recently needed to make a tweet button that would dynamically change the text that was posted to twitter based on the date. Here is the standard code for a tweet button: <a href="http://twitter.com/share" class="twitter-share-button" data-text="This is what we want to change dynamically" data-count="none" data-via="chris_camps">Tweet</a> <script...
Mar 25th
February 2011
0 posts
Quick macports migration tip
There is a way to get macports to show you only the packages you told it to install, as opposed to the whole installed dependency tree. This is extremely useful when setting up a new system. $ port echo requested This will give you a nice concise list of the packages you really want, so you can pick and choose what to install on your new system. apache2 ...
Feb 1st
June 2010
1 post
2 tags
iPad HTML5 Video mime problem
I know. You have been beating your keyboard against your desk for hours getting that html5 video embed test working in MobileSafari on the iPad. You must have melted a small glacier re-encoding with every combination of container, encoding, and bitrate! You checked and double checked your video tag. (You made sure to close the </video> and </source> tags right? Of course you did....
Jun 23rd
May 2010
1 post
4 tags
Turn your mac into a Pandora alarm clock
Here’s a tutorial for anyone wanting to turn their fancy new $2000 Mac into a $19.99 clock radio. We’re going to use AppleScript, iCal, and the awesome PandoraBoy to get everything working. I thought this would be clunky at first but it’s actually really nice and flexible if you break things up the way I’m about to show you. Open up your AppleScript Editor and...
May 13th
April 2010
1 post
2 tags
How to kill an unresponsive ssh session →
I love stumbling on clean solutions to little annoyances I deal with regularly. Anyone who uses ssh on a regular basis definitely knows how this story goes. You have all your terminal windows/tabs arranged exactly how you like them. Then BOOM, one of your ssh sessions hangs, making that entire window unusable. <CTRL>-C you say? Hah hah, I laugh ironically at your feeble term-fu. You have...
Apr 28th
4 notes
March 2010
1 post
2 tags
How to avoid accidentally zooming in Firefox with...
I got an Apple Magic Mouse recently and overall it’s quite nice. The momentum scrolling is an important evolution. The momentum sometimes has side effects in apps that are not expecting it though. Firefox is one of these apps. I tend to browse with many tabs open, and I like to switch between open tabs with control+tab and control+shift+tab (on mac). The problem occurs when you flick...
Mar 11th
April 2007
0 posts
2 tags
How To Keep Your Data Forever
We’ve all sustained painful data losses at some point or another. After a number of years, you start to realize that you’re tired of getting sucker punched, and that you have the skill and knowledge to solve the problem once and for all. I’m going to outline here a relatively simple strategy to keep a set of data alive for the rest of your life. This article is meant to give...
Apr 1st