Skip to content

Instantly share code, notes, and snippets.

View zachwaugh's full-sized avatar

Zach Waugh zachwaugh

View GitHub Profile
@zachwaugh
zachwaugh / console_test.js
Created February 23, 2011 16:51
Testing node.js console.log output string quoting
console.log('100', 'something');
console.log(100, 'something');
console.log(100, 'something', 'something else');
console.log(100 + ' something');
console.log('something', 100, 'something');
@zachwaugh
zachwaugh / fix-twitter.scpt
Created January 26, 2011 18:14
AppleScript to fix twitter appearing on all spaces issue
tell application "System Events"
set x to application bindings of spaces preferences of expose preferences
set x to {|com.twitter.twitter-mac|:3} & x -- 3 is any space you don't want twitter on
set application bindings of spaces preferences of expose preferences to x
set x to {|com.twitter.twitter-mac|:4} & x -- 4 is the space you want twitter to be on
set application bindings of spaces preferences of expose preferences to x
end tell
@zachwaugh
zachwaugh / gist:521133
Created August 12, 2010 15:19
Loading rails environment in a script
#!/usr/bin/env ruby
# Load Rails
ENV['RAILS_ENV'] = ARGV[0] || 'production'
DIR = File.dirname(__FILE__)
require DIR + '/../config/environment'
# ... do stuff that requires using your rails models
@zachwaugh
zachwaugh / jquery.fadeoutandremove.js
Created June 1, 2010 15:36
jQuery plugin to handle fading out and removing and element from the DOM
/*!
* Fade Out element and remove from DOM
*/
(function($)
{
$.fn.fadeOutAndRemove = function(duration)
{
duration = (duration === undefined) ? 250 : duration;
return this.fadeOut(duration, function()