all libraries are open source, unless otherwise mentioned
XUI - DOM manipulation, Ajax, Events, CSS, FX
http://github.com/xui/xui
Lawnchair - offline storage wrapper
all libraries are open source, unless otherwise mentioned
XUI - DOM manipulation, Ajax, Events, CSS, FX
http://github.com/xui/xui
Lawnchair - offline storage wrapper
For best results, use hub and git bash completion (included with git under contrib/completion
).
/** | |
* 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. | |
* |
// 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', |
(function(window, document, notDefined) { | |
/** | |
* Do not use thumbs.js on touch-enabled devices | |
*/ | |
if (document.ontouchstart!=notDefined) return; | |
/** | |
* Map touch events to mouse events | |
*/ |
// 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++) { |
# 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 is some text right here |
<html> | |
<body></body> | |
<script src="phonegap.js"></script> | |
<script> | |
function assert(msg, booleanCondition) { | |
if (!booleanCondition) { | |
alert("assertion failed: " + msg); | |
return false; | |
} else { | |
return true; |
require 'time' | |
def all_dates filename | |
`git log --pretty=format:%ai #{ filename }`.split("\n") | |
end | |
def created_at filename | |
Time.parse all_dates(filename).last | |
end |