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
View Constructor: | |
this.configure(options); | |
this._reset(); | |
this.render(); | |
Base View | |
.el - conventional root element reference for every view | |
.toElement - returns this.el | |
.childViews - Array of child views |
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
#! /usr/bin/env ruby | |
require 'rubygems' | |
require 'hpricot' | |
username = "<username>" | |
password = "<password>" | |
tix = Hpricot(IO.popen("curl https://trac.zenbe.com/report/7 --basic -u #{username}:#{password} -k -s")) | |
(tix/"table.listing.tickets"/"tbody"/"tr").each do |row| |
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
tcp: require 'tcp' | |
server: tcp.createServer (socket) -> | |
client: null | |
socket.addListener 'connect', -> | |
client: tcp.createConnection 22 | |
client.addListener 'receive', (data) -> socket.send(data) | |
client.addListener 'eof', -> client.close() |
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.prototype.curry: (scope, rest...) -> | |
scope ||= this | |
=> @apply(scope, rest) |
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
class B extends A | |
constructor: -> | |
@where_am_i: 'at work' | |
sayWhereYouAre: -> | |
alert 'I am ' + @where_am_i |
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 nodeFactory() { | |
function toStringFactory(data) { return function toString() { | |
// TODO: Implement | |
}} | |
function compileFactory(data) { return function compile() { | |
// TODO: Implement | |
}} | |
return { | |
BaseNode: function (data) { | |
return { |
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
routes: {} | |
get: (route, handler) -> | |
routes[route]: handler | |
############################################# | |
get 'greet/:name', (request) -> | |
"Hello " + request.params['name'] |
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
var __slice = function(array, from, to) { | |
return array.slice( | |
from < 0 ? from + array.length : from || 0, | |
to < 0 ? to + array.length : to == 0 ? to : array.length | |
); | |
}; |
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
func: (should_i) -> | |
do_it() if should_i = true | |
somevar: 0 | |
while should_i = true | |
do_it() | |
somevar: somevar + 1 | |
should_i: false | |
# Compared to |
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
# This Python: | |
@cache('public') | |
@get('/') | |
def hello(): | |
return 'Hello World!' | |
# Can be done like this with CoffeeScript: |
OlderNewer