This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Require libraries | |
var os = require("os"); | |
var fs = require("fs"); | |
var readline = require("readline"); | |
var cluster = require("cluster"); | |
var express = require("express"); | |
var site = express(); | |
// Var up, bro | |
var i, read; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Basic Usage: | |
// | |
// var main = new Canvas({ elem: "canvas" }, function(options) { | |
// // Instantiate anything specific here... | |
// // Main draw loop | |
// this.draw = function() { | |
// | |
// }; | |
// }); | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var buildMap = {}; | |
/* RequireJS Use Plugin v0.2.0 | |
* Copyright 2012, Tim Branyen (@tbranyen) | |
* use.js may be freely distributed under the MIT license. | |
*/ | |
define({ | |
version: "0.2.0", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const grid = buildGrid(20, 50, [ | |
(10 * 50) + 20, | |
(10 * 50) + 21, | |
(10 * 50) + 22, | |
(10 * 50) + 23, | |
(10 * 50) + 24, | |
(10 * 50) + 25, | |
(10 * 50) + 26, | |
(10 * 50) + 27, | |
(10 * 50) + 28, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Pretend app setup stuff is here */ | |
/* Kick off app */ | |
jQuery(function($) { | |
var Gallery = app.module("gallery"); | |
app.Router = Backbone.Router.extend({ | |
initialize: function() { | |
this.gallery = new Gallery.Router("gallery/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doubleTouch(element, callback) { | |
if ((!element && !callback) || (!callback && typeof element !== 'function')) { | |
return; | |
} else if (!callback && typeof element === 'function') { | |
callback = element; | |
element = document; | |
} | |
var taps = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by http://bit.ly/juSAWl | |
// Augment String.prototype to allow for easier formatting. This implementation | |
// doesn't completely destroy any existing String.prototype.format functions, | |
// and will stringify objects/arrays. | |
String.prototype.format = function(i, safe, arg) { | |
function format() { | |
var str = this, len = arguments.length+1; | |
// For each {0} {1} {n...} replace with the argument in that position. If |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { innerHTML, html } from 'https://unpkg.com/diffhtml/dist/es'; | |
let a = 1; | |
let b = 2; | |
const updateA = ({ target }) => (a = Number(target.value), render()); | |
const updateB = ({ target }) => (b = Number(target.value), render()); | |
function render() { | |
innerHTML(document.body, html` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* backbone.collectioncache.js v0.0.2 | |
* Copyright 2012, Tim Branyen (@tbranyen) | |
* backbone.collectioncache.js may be freely distributed under the MIT license. | |
*/ | |
(function(window) { | |
"use strict"; | |
// Dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Application. | |
var app = require("app"); | |
// Page specific Views. | |
var Views = require("modules/page/views"); | |
module.exports = Backbone.Model.extend({ | |
defaults: { | |
title: "Unknown Page" | |
}, |