Skip to content

Instantly share code, notes, and snippets.

View dannyfritz's full-sized avatar
🐦
chirping

Danny Fritz dannyfritz

🐦
chirping
View GitHub Profile
@dannyfritz
dannyfritz / index.js
Last active August 29, 2015 14:15
requirebin sketch
var nanoscope = require('nanoscope');
var _ = require('lodash');
var game = {
player: {
x: 0
},
board: {
width: 10
}
@dannyfritz
dannyfritz / index.js
Created February 11, 2015 04:46
requirebin sketch
var test = require('tape');
test('timing test', function (t) {
t.plan(2);
t.assert(true);
t.assert(false);
});
{
init: function (elevators, floors)
{
var requestQueue = [];
var request = function (floor, direction)
{
requestQueue.push({
floor: floor,
direction: direction
});
...
var legacyScriptsArr = [
'./path/to/legacy-script1.js',
'./path/to/legacy-script2.js',
'./path/to/legacy-script3.js',
'./path/to/legacy-script4.js',
'./path/to/legacy-script5.js',
];
@dannyfritz
dannyfritz / app.js
Last active August 29, 2015 14:06
My Website!
var $body = $(document.body);
var $welcome = $('<h1>My Website!!!</h1>');
$body.append($welcome);
var $awesome = $('<p>This is so awesome!</p>');
$body.append($awesome);
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['lodash'], factory);
} else {
root.amdWeb = factory(root._);
}
}(this, function (b) {
var Fond = function(options) {
this.update = function() {};
this.draw = function() {};
var age_group =
age > 70 ? 'se' :
age > 60 ? 'si' :
age > 50 ? 'fi' :
age > 40 ? 'fo' :
age > 30 ? 'th' :
age > 20 ? 'tw' :
'un';