For best results, use hub and git bash completion (included with git under contrib/completion
).
This file contains hidden or 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
# sed in place, for OS X (Darwin) and Linux | |
# user-agent detection - probably not the best way | |
DASHI='' | |
unamestr=`uname` | |
if [[ "$unamestr" == 'Linux' ]]; then | |
DASHI="-i" | |
elif [[ "$unamestr" == 'Darwin' ]]; then | |
DASHI='-i ""' |
This file contains hidden or 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
// check which style properties are different between two DOM elements | |
// obv. needs a browser with getComputedStyle | |
function styleDiff(first, second) { | |
var oneStyle = getComputedStyle(first), | |
twoStyle = getComputedStyle(second), | |
diff = [], | |
i, | |
prop; | |
for (i = 0; i < oneStyle.length; i++) { |
This file contains hidden or 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(window, document, notDefined) { | |
/** | |
* Do not use thumbs.js on touch-enabled devices | |
*/ | |
if (document.ontouchstart!=notDefined) return; | |
/** | |
* Map touch events to mouse events | |
*/ |
This file contains hidden or 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
// lazy loading and caching templates | |
// callback receives rendered html - can write to the DOM or whatnot | |
var TMPL_PREFIX = 'tmpl.' | |
function renderTemplate(callback, identifier, data) { | |
// check localStorage for identifier | |
var data = data || {}, | |
key = TMPL_PREFIX + identifier, | |
url = 'templates/' + identifier + '.mustache', |
This file contains hidden or 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
/** | |
* Contains utility functions to be used in various places. | |
*/ | |
var util = {}; | |
/** | |
* Checks the types and sanitizes arguments for functions with optional | |
* parameters and default values. | |
* |
all libraries are open source, unless otherwise mentioned
XUI - DOM manipulation, Ajax, Events, CSS, FX
http://github.com/xui/xui
Lawnchair - offline storage wrapper
This file contains hidden or 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
document.addEventListener('click', function (evt) { | |
if (typeof evt.target.ontouchend == 'function') { | |
evt.target.ontouchend.call(evt.target, evt); | |
} | |
}, false); |
This file contains hidden or 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
(higgins={bot:function(){return Math.random()>0.5?"it's just JavaScript":"Dojo already did it"}}).bot() |
This file contains hidden or 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
// private method | |
// Wraps the HTML in a TAG, Tag is optional | |
// If the html starts with a Tag, it will wrap the context in that tag. | |
// doesn't ACTUALLY work | |
function wrap(xhtml, tag) { | |
// new approach | |
// createDocumentFragment | |
var docFrag = document.createDocumentFragment(), | |
dummy, | |
wrapTag; |