Skip to content

Instantly share code, notes, and snippets.

underscore@1.2.0 /home/max/local/lib/node_modules/zanza/node_modules/underscore
log4js@0.3.9 /home/max/local/lib/node_modules/zanza/node_modules/log4js
sass@0.5.0 /home/max/local/lib/node_modules/zanza/node_modules/sass
coffee-script@1.1.2 /home/max/local/lib/node_modules/zanza/node_modules/coffee-script
run@0.1.1 /home/max/local/lib/node_modules/zanza/node_modules/run
backbone@0.5.3 /home/max/local/lib/node_modules/zanza/node_modules/backbone
bcrypt@0.4.0 /home/max/local/lib/node_modules/zanza/node_modules/bcrypt
mkdirp@0.0.7 /home/max/local/lib/node_modules/zanza/node_modules/express/node_modules/mkdirp
qs@0.3.1 /home/max/local/lib/node_modules/zanza/node_modules/express/node_modules/qs
mime@1.2.4 /home/max/local/lib/node_modules/zanza/node_modules/express/node_modules/mime
fs = require 'fs'
path = require 'path'
isDirectory = (base, p) ->
fullPath = path.resolve base, p
fs.statSync(fullPath).isDirectory()
mergeExports = (theExports, otherModule) ->
for otherExport, func of otherModule
theExports[otherExport] = otherModule[otherExport]
class Tileset
{
private Dictionary<String, Texture2D> tiles;
public Texture2D this[string key]
{
get
{
return tiles[key];
}
}
class Job < Sequel::Model
plugin :serialization, :marshal, :args
end
function Person(){}
Person.prototype.greet = function(){ alert("Hi!"); };
var p = new Person();
JSON.parse(JSON.stringify(p)).greet(); // throws Object #<an Object> has no method 'greet' in Chrome
mixin DumbEqualsOperand
equals: (other) ->
this == other
class MyClass implements DumbEqualsOperand
m = new MyClass
n = new MyClass
console.log(m.equals n)
@nanodeath
nanodeath / spec_custom_matchers.rb
Created November 21, 2010 17:54
Main file containing your custom matchers
# Custom matchers
module CustomMatchers
class TimeTaken
def initialize(lower_seconds, upper_seconds=nil)
@lower_seconds = lower_seconds
@upper_seconds = upper_seconds
end
def matches?(given_proc)
range = @lower_seconds..@upper_seconds
require "thread"
require "monitor"
require "timeout"
class Worker < Thread
def initialize(joblist, mon, input_cv, output_cv)
@busy = false
@mon = mon
super do
while true
<!--
<script src="/external.js"></script>
<!-- -->
Even this doesn't quite work -- it works on Chrome, but Firefox prints out "<!--".
x_file = "x.txt"
task :prepare_x do
bunch_of_files = calculate_all_upstream_files_slowly
bunch_of_files.each {|filename| file x_file => filename}
end
task :real_x => [x_file]
task :x => [:prepare_x, :real_x]