Skip to content

Instantly share code, notes, and snippets.

Mx Corey Frang gnarf

Block or report user

Report or block gnarf

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 gist:0a26d2e58952b459aa99
exports.up = function (knex) {
return knex.schema.createTable('list', function (t) {
t.increments('id');
t.integer('owner_id').notNullable();
t.text('name').notNullable();
t.timestamp('last_modified');
});
};
exports.down = function (knex) {
View 1-file.txt
foo bar
baz
qux
last line (there may or may not be a trailing newline after this line)
View err.js
var clone = require("./").Clone.clone;
function errorLog(err) {
console.error(err);
}
// Look up this known commit.
function getCommit(repo) {
// Use a known commit sha from this repository.
return repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5");
View gist:a59255719f0b06322d96
sh: napa: command not found
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.7.3
npm ERR! code ELIFECYCLE
npm ERR! ember-templates-loader@1.3.0 install: `napa`
npm ERR! Exit status 127
npm ERR!
@gnarf
gnarf / test.js
Last active Sep 19, 2015 — forked from tbranyen/test.js
WebComponent Backbone-events like
View test.js
class CustomElement extends HTMLElement {
constructor() {
super();
}
attachedCallback() {
this.bindEvents();
}
detachedCallback() {
View gist:842425
$(document).ready(function(){
function rem(e){
alert("asdfasdf");
};
$("#remove").click(rem);
});
@gnarf
gnarf / gist:951480
Created May 2, 2011
widget show/hide function
View gist:951480
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
options = options || {};
var hasOptions = !$.isEmptyObject( options ),
effectName = options.effect || defaultEffect;
options.complete = callback;
if (options.delay) {
element.delay( options.delay );
}
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
@gnarf
gnarf / gist:952142
Created May 2, 2011
fn.promise() the way I saw it
View gist:952142
// Get a promise resolved when the currently queued functions complete
promise: function( type ) {
type = type || "fx";
var defer = jQuery.Deferred(),
elements = this,
count = elements.length;
function resolve( next ) {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
@gnarf
gnarf / gist:960850
Created May 7, 2011
Unit test for bug #9074
View gist:960850
test( "animate properties missing px w/ opacity as last (#9074)", 2, function() {
expect( 6 );
stop();
var div = jQuery( "<div style='position: absolute; margin-left: 0; left: 0px;'></div>" )
.appendTo( "#qunit-fixture" );
function cssInt( prop ) {
return parseInt( div.css( prop ), 10 );
}
equal( cssInt( "marginLeft" ), 0, "Margin left is 0" );
equal( cssInt( "left" ), 0, "Left is 0" );
View gist:968692
function present( value, array, message ) {
QUnit.push( jQuery.inArray( value, array ) !== -1 , value, array, message );
}
function notPresent( value, array, message ) {
QUnit.push( jQuery.inArray( value, array ) === -1 , value, array, message );
}
You can’t perform that action at this time.