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
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { | |
// no easing, no acceleration | |
linear: function (t) { return t }, | |
// accelerating from zero velocity | |
easeInQuad: function (t) { return t*t }, | |
// decelerating to zero velocity |
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
/* RequireJS Use Plugin v0.1.0 | |
* Copyright 2012, Tim Branyen (@tbranyen) | |
* use.js may be freely distributed under the MIT license. | |
*/ | |
define(function() { | |
var buildMap = {}; | |
return { | |
version: "0.1.0", |
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 extend() { | |
var i, prop, source; | |
var args = Array.prototype.slice.call(arguments); | |
var destination = args.shift(); | |
for (i=0; i<args.length; i++) { | |
source = args[i]; | |
for (prop in source) { | |
destination[prop] = source[prop]; |
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
/**********************************************/ | |
/* | |
/* IR_Black Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Todd Werth's IR_Black: | |
/* http://blog.toddwerth.com/entries/2 | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
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
#!/usr/bin/env node | |
// Copyright 2011, Tim Branyen @tbranyen <[email protected]> | |
// Dual licensed under the MIT and GPL licenses. | |
// Script to detect cursewords in commit messages and provide the | |
// offending commit sha's. | |
var git = require('nodegit'); | |
var curses = ['fuck', 'shit', 'bitch', 'ass', ], | |
path = './.git', |
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
//////////////// | |
// IN CONSOLE // | |
//////////////// | |
Blah = Model("blah", { | |
persistence: Model.localStorage(), | |
find_by_uid: function(uid) { | |
return this.detect(function() { | |
return this.uid == uid |
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
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
bar[ foo ? 'doSomething' : 'doSomethingElse' ]( el ); | |
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
// Skeleton jQuery Plugin (OO) | |
(function($){ | |
$.fn.myPlugin = function( options ){ | |
options = $.extend( {}, $.fn.myPlugin.defaults, options ); | |
return this.each(function(){ | |
// create a new object & store it in the element's data for easy access | |
$(this).data('myPlugin', new MyPlugin(this, options)); |