This file contains hidden or 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
<html> | |
<head> | |
<script src='http://code.jquery.com/jquery-1.5.1.min.js'></script> | |
</head> | |
<body> | |
<h2>Naive canvas</h2> | |
<canvas id="naive" width="400" height="50"></canvas> | |
<h2>High-def Canvas</h2> |
This file contains hidden or 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
<script type="text/javascript"> | |
window.RAILS_ENV = '<%= RAILS_ENV %>'; | |
window.SERVER_ROOT = '<%= DC.server_root %>'; | |
window.SERVER_ROOT_HTTP = '<%= DC.server_root(:ssl => false) %>'; | |
<% if workspace %> | |
Organizations.refresh(<%= @organizations.to_json %>); | |
<% if @current_account %> | |
<%= render :partial => 'accounts/current_account.js', :type => :js %> | |
Accounts.refresh(<%= @accounts.to_json %>); | |
Projects.refresh(<%= @projects.to_json({:account => @current_account, :include_collaborators => true}) %>); |
This file contains hidden or 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
/** | |
* counter | |
* ======= | |
* Creates counter that will generate number, starting from `start` (default to 0) | |
* incrementing (or decrementing) by `step` (default to 1). Based on | |
* [Python's itertools.count](http://docs.python.org/library/itertools.html#itertools.count). | |
* | |
* cycle | |
* ===== | |
* Returns a function that will generate items in `iterable` for each call, |
This file contains hidden or 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
define.defs = {}; | |
define.modules = {}; | |
function define(name, fn) { | |
define.defs[name] = fn; | |
} | |
function require(name) { | |
if (define.modules.hasOwnProperty(name)) return define.modules[name]; | |
if (define.defs.hasOwnProperty(name)) { | |
var fn = define.defs[name]; | |
define.defs[name] = function () { throw new Error("Circular Dependency"); }; |
This file contains hidden or 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
defs = {}; | |
modules = {}; | |
function define(name, fn) { | |
defs[name] = fn; | |
} | |
function require(name) { | |
console.log("Loading " + name); | |
if (modules.hasOwnProperty(name)) return modules[name]; | |
if (defs.hasOwnProperty(name)) { | |
var fn = defs[name]; |
This file contains hidden or 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
/* | |
UPDATE: this has finally been pushed to npm as `fs.extra` | |
URL: https://github.com/coolaj86/utile-fs/tree/master/fs.extra | |
*/ | |
(function () { | |
"use strict"; | |
console.warn('[Deprecated] See https://github.com/coolaj86/utile-fs'); | |
var fs = require('fs') |
This file contains hidden or 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 sys = require('sys'); | |
var filestem = process.ARGV.length > 2 ? process.ARGV.length[2] : "screen"; | |
var spawn = require('child_process').spawn, | |
timer = null, | |
startTime, stopTime; | |
function outfile(d) { |
This file contains hidden or 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 define(name, fn) { | |
if (!defs) { defs = {}; } | |
defs[name] = fn; | |
} | |
function require(name) { | |
console.log("Loading " + name); | |
if (modules && modules.hasOwnProperty(name)) return modules[name]; | |
if (defs && defs.hasOwnProperty(name)) { | |
if (!modules) { modules = {}; } | |
var fn = defs[name]; |
This file contains hidden or 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
### | |
# JSONDB - a compressed JSON format | |
# By Devon Govett | |
# Originally proposed by Peter Michaux - http://michaux.ca/articles/json-db-a-compressed-json-format | |
# | |
# jsondb.pack converts an array of objects with the same keys (i.e. from a database) | |
# and flattens them into a single array, which is much smaller than the pure json | |
# representation where the keys are repeated for each item in the array. | |
# Combine with JSON.stringify to send compressed JSON data over the network. | |
# |