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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller | |
// fixes from Paul Irish and Tino Zijdel | |
// little saving... | |
(function(w, a, b, af, x, lastTime, v) { | |
var c = "c" + a, |
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
#!/bin/sh | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis.pid |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.redis.redis-server</string> | |
<key>Program</key> | |
<string>/usr/local/redis/bin/redis-server</string> | |
<key>ProgramArguments</key> |
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($){ | |
$.extend($.fn,{ | |
blockit: function(options){ | |
new BlockIt(this, options); | |
return this; | |
} | |
}); | |
var BlockIt = function(el, options){ | |
var options = options || {}, |
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 wth_sort(k){ | |
for(var l,p=(l=k.slice()).shift(),m={},n=((m['true']=[])&&(m['false']=[]));l.length;)m[l[0]>p].push(l.shift()); | |
return (p&&arguments.callee(m[!1]).concat(p).concat(arguments.callee(m[!0])))||k; | |
} |
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 wtf_sort(llll){ | |
for(var l1ll=llll.length;l1ll;) | |
for(var l11l,ll1l=(l11l=llll.length)-(l1ll--);(l11l--)-(ll1l);(llll[l11l]<llll[l11l-1])?llll[l11l]=(llll[l11l-1]^=llll[l11l]^=llll[l11l-1])^llll[l11l]:l11l); | |
return llll; | |
} |
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
// listener object for attaching functions to be called after events | |
/** | |
* listener - Singleton. used to subscribe to and fire events | |
*/ | |
var listener = function(){ | |
/** | |
* @param {Object} evts the container for all event listeners | |
* @private | |
*/ |
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
# Capistrano task for tailing logs on multiple servers | |
desc "tail log files, use '-s grep=[search text]' and '-s file=[file name]' to grep and tail specific file respectively" | |
task :tail_logs, :roles => :app do | |
set :grep, fetch(:grep, "") | |
set :file, fetch(:file,"~/current/log/production.log") | |
set(:g) { (grep == "") ? "" : " | grep #{grep}" } | |
run "tail -f #{file} #{g}" do |channel, stream, data| | |
#put hostname in front of each line | |
puts "#{data}".gsub( /(^)/i,"#{channel[:host]} \\1") |
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
// jQuery extension for checking if css media query is supported | |
(function($){ | |
$.mediaCheck = function (qry){ | |
var ret, | |
style = document.createElement('style'), | |
id = 'mqc_'+Math.floor(Math.random()*100)+new Date().getTime(), | |
rules = document.createTextNode('@media '+qry+' {#'+id+'{visibility:hidden !important}}'), | |
head = $('head')[0]; | |
body = $('body'); |