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
require 'rubygems' | |
desc "Completely empty /build" | |
task :clobber do | |
sh "rm -rf build/* build/.[Dh]*" | |
end | |
desc "Export compiled build" | |
task :build do | |
sh "mm-build" |
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
if (!Modernizr.input.placeholder){ | |
$('input[placeholder],textarea[placeholder]').each(function(){ | |
var input = $(this); | |
if (!input.attr('placeholder')) return; | |
var ph = input.attr('placeholder'); | |
input.val(ph); | |
input.focus(function(){ | |
if (input.val() == ph) input.val(''); | |
}); |
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
local user_host='%{$fg[green]%}%n@%m%{$reset_color%}' | |
local current_dir='%{$fg[yellow]%} %~%{$reset_color%}' | |
local git_branch='$(git_prompt_info)%{$reset_color%}' | |
PROMPT=" | |
${user_host}${current_dir} ${git_branch} | |
⑆ " | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}(" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
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
// relies on Date.now() which has been supported everywhere modern for years. | |
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values | |
(function(window) { | |
// prepare base perf object | |
if ("performance" in window) {} else { | |
window.performance = {}; | |
} | |
if ("now" in window.performance) {} else { | |
var nowOffset = Date.now(); | |
if ("timing" in window.performance && "navigationStart" in window.performance.timing) { |
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
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence : Improved by brunoais | |
(function(win, doc) { | |
if (win.addEventListener) { | |
return; | |
} | |
//No need to polyfill | |
function docHijack(p) { | |
var old = doc[p]; | |
doc[p] = function(v) { | |
return addListen(old(v)); |
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
// Decay class, to call a callback less and less often. For example, | |
// make an Ajax request and freshen the decay only if the request has changed. | |
// | |
// To start the timeouts, call decay_object.start() | |
// To freshen up the speed of query, call decay_object.reset() | |
// | |
// Options: | |
// - seconds: time between each callback at the start and after a reset() (default 2) | |
// - decay: multiplier to use after each callback call (default 1.3) | |
// - max: maximum number of seconds to wait between each call (default 42) |
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
/* | |
* HTML Parser By John Resig (ejohn.org) | |
* Original code by Erik Arvidsson, Mozilla Public License | |
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js | |
* | |
* // Use like so: | |
* HTMLParser(htmlString, { | |
* start: function(tag, attrs, unary) {}, | |
* end: function(tag) {}, | |
* chars: function(text) {}, |
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
if (!document.querySelectorAll) { | |
document.querySelectorAll = function (selectors) { | |
var style = document.createElement('style'), elements = [], element; | |
document.documentElement.firstChild.appendChild(style); | |
document._qsa = []; | |
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}'; | |
window.scrollBy(0, 0); | |
style.parentNode.removeChild(style); |