Skip to content

Instantly share code, notes, and snippets.

// Torque Alternative Syntax
if (!isObject(FollowMouseBehavior))
%template = new BehaviorTemplate(FollowMouseBehavior);
%template.friendlyName = "...";
%template.behaviorType = "...";
%template.description = "...";
# --- Variables
!width = 1008px
!dark = #141414
!light_grey = #636363
!lighter_grey = #efefef
!lighter_lighter_grey = #e3e3e3
!light_blue = #119de5
# --- Mixins
// JSpec - Core - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
(function(){
JSpec = {
version : '0.9.6',
main : this,
suites : [],
describe 'ShoppingCart'
before_each
.cart = new ShoppingCart
end
describe 'addProducts'
it 'should add several products'
.cart.addProduct('cookie')
.cart.addProduct('icecream')
.cart.should.have 2, 'products'
// Screw.Unit
expect(person.pets.length).to(equal, 2)
// JSpec
person.should.have 2, 'pets'
// --- Screw.Unit
describe('Person', function(){
var person
before(function(){
person = new Person
})
describe('.addPet', function(){
#!/usr/bin/env ruby
require 'rubygems'
require 'commander'
program :version, '0.0.1'
program :description, 'Does some foo'
global_option '-c', '--config FILE', 'Load configuration'
./foo bar --verbose --config rawr
verbose = true
config = "rawr"
// Alternative JavaScript Syntax
Person = :(name, address) { @name!, @address! }
Person::inspect = :{ <: "{@name} lives at {@address}" }
tj := Person('TJ', '314 Bessborough ave')
bob := Person('Bob', 'Some place')
[tj, bob].each(:(person){ print(person.inspect()) })
---
--- Tag
---
data Tag = Tag {
tagType :: String,
tagAttrs :: [Attr]
}