Skip to content

Instantly share code, notes, and snippets.

@ehynds
ehynds / easing.js
Last active August 29, 2015 14:08 — forked from gre/easing.js
/*
* 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
@ehynds
ehynds / use.js
Created February 2, 2012 19:45 — forked from tbranyen/use.js
A RequireJS compatible plugin to provide shimming capabilities declaratively.
/* 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",
@ehynds
ehynds / extend.js
Created January 18, 2012 22:33 — forked from tbranyen/extend.js
Minimalist extend function
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];
@ehynds
ehynds / Custom.css
Created August 17, 2011 15:27 — forked from bentruyman/Custom.css
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* 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/
/*
#!/usr/bin/env node
// Copyright 2011, Tim Branyen @tbranyen <tim@tabdeveloper.com>
// 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',
@ehynds
ehynds / blah.js
Created March 1, 2011 14:45 — forked from benpickles/blah.js
////////////////
// IN CONSOLE //
////////////////
Blah = Model("blah", {
persistence: Model.localStorage(),
find_by_uid: function(uid) {
return this.detect(function() {
return this.uid == uid
@ehynds
ehynds / screening.js
Created September 14, 2010 17:12 — forked from rmurphey/screening.js
// 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 );
// 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));