This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' | |
killall Dock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function traceEventOffset(target_el, event){ | |
var current_el = event.target | |
, cur_left = 0 | |
, cur_top = 0 | |
;//var | |
while(current_el != target_el){ | |
cur_left += current_el.offsetLeft; | |
cur_top += current_el.offsetTop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function injectScript(src, callback){ | |
var s = document.createElement('script') | |
;//var | |
s.type = 'text/javascript'; | |
s.src = src; | |
s.async = true; | |
s.onreadystatechange = s.onload = function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Defer(callback){ | |
if(!this instanceof Defer) | |
return new Defer(callback); | |
var queue = [] | |
, callback = callback | |
, slice = Array.prototype.slice | |
, changeling = function(){ | |
queue.push({ | |
'context': this, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findPos(obj){ | |
var cur_left = 0 | |
, cur_top = 0 | |
;//var | |
if(obj.offsetParent){ | |
do{ | |
cur_left += obj.offsetLeft; | |
cur_top += obj.offsetTop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created using underscore.js source code | |
// === INHERIT HELPER === | |
// used to create subclasses | |
var // empty function used for dummy constructor | |
ctor = function(){} | |
// method for extending objects | |
// recommended that you replace with something | |
//from a library such as underscore.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function asyncCount(num, callback){ | |
if(!this instanceof asyncCount) | |
return new asyncCount(num, callback); | |
var count = num; | |
return function(){ | |
--count || callback(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var STATES = { | |
'Alabama' : 'AL', | |
'Alaska' : 'AK', | |
'Arizona' : 'AZ', | |
'Arkansas' : 'AR', | |
'California' : 'CA', | |
'Colorado' : 'CO', | |
'Connecticut' : 'CT', | |
'Delaware' : 'DE', | |
'DistrictofColumbia': 'DC', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* app.util.base64 encode / decode | |
* http://www.webtoolkit.info/ | |
**/ | |
app.util.base64 = { | |
// private property | |
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", | |
// public method for encoding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function performOnceOn(model){ | |
// store our model in the closure | |
var model = model; | |
return function(conditions, callback){ | |
// internally reference params for use in nested functions | |
var callback = callback | |
, conditions = conditions | |
, current = model.attributes |