Skip to content

Instantly share code, notes, and snippets.

Aaron Forsander pifantastic

Block or report user

Report or block pifantastic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View components.my-component.js
import Ember from 'ember';
// Mock underscore.
let _ = {
includes: function(val) {
return this.indexOf(val) !== -1;
}
};
function enumProp(def, valid) {
View keybase.md

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:

View gist:8822073
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 Dec 16, 2013
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.
View README.md

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.

View grunt_helpers.js
// 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;
}));
};
};
View gist:7434385
package main
import (
"fmt"
goquery "github.com/PuerkitoBio/goquery"
"sync"
"time"
)
var start = time.Now()
View gist:7091819
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")();
View gist:7091789
foo("lol")("wat")("bar")(); // "lol wat bar"
View colorHash.js
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));
View 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);
You can’t perform that action at this time.