Skip to content

Instantly share code, notes, and snippets.

View pifantastic's full-sized avatar

Aaron Forsander pifantastic

  • Stripe
  • Austin, TX
View GitHub Profile
import Ember from 'ember';
// Mock underscore.
let _ = {
includes: function(val) {
return this.indexOf(val) !== -1;
}
};
function enumProp(def, valid) {

Keybase proof

I hereby claim:

  • I am pifantastic on github.
  • I am forsander (https://keybase.io/forsander) on keybase.
  • I have a public key whose fingerprint is 77FA 89D6 D5C8 F0BE 518B D7A4 11EF 18B0 F691 E071

To claim this, I am signing this object:

define([
'fixtures'
], function (fixtures) {
describe('Some unit tests', function () {
before(function () {
/**
* Will add the following HTML to the DOM before running the following tests:
*
@pifantastic
pifantastic / README.md
Created December 16, 2013 17:34
Create this file in your project's root dir: `.git/hooks/pre-commit` Make it executable: `chmod +x .git/hooks/pre-commit` You can remove `test` if you just want to `lint` and vice versa.

Create this file in your project's root dir: .git/hooks/pre-commit

Make it executable: chmod +x .git/hooks/pre-commit

You can remove test if you just want to lint and vice versa.

// Allow tasks to inherit a target.
var targetify = function( tasks ) {
return function( target ) {
grunt.task.run( tasks.map(function( name ) {
// Target may be blank.
return target ? name + ':' + target : name;
}));
};
};
package main
import (
"fmt"
goquery "github.com/PuerkitoBio/goquery"
"sync"
"time"
)
var start = time.Now()
function foo(a){var b=a;return function c(a){return"undefined"!=typeof a?(b+=' '+a,c):(console.log(b),void 0)}}foo("lol")("wat")("bar")();
foo("lol")("wat")("bar")(); // "lol wat bar"
var colorHash = function (str) {
// djb2 hash: http://www.cse.yorku.ca/~oz/hash.html
var hash = 5381;
for (i = 0; i < str.length; i++) {
hash = ((hash << 5) + hash) + str.charCodeAt(i);
}
// Help from: http://www.paulirish.com/2009/random-hex-color-code-snippets/
var color = Math.round(11184810 * Math.abs(hash) / Math.pow(2, 32));
@pifantastic
pifantastic / thing.js
Last active December 10, 2015 00:59 — forked from cowboy/thing.js
function Thing(prop) {
this.prop = prop;
}
Thing.prototype.toString = function() {
return "My prop is: " + this.prop;
};
module.exports = function (opts) {
return new Thing(opts);