Skip to content

Instantly share code, notes, and snippets.

View jashkenas's full-sized avatar

Jeremy Ashkenas jashkenas

View GitHub Profile
options =
callback: => @interviewEditor.setup()
menuId: '#setup_interview'
$('#main_menu li#setup_interview a').bind 'click', options, @menuClickCallback
class MainMenu
interviewEditor = null
highlight: (menuId) ->
$('#main_menu li').removeClass('active_menu_item')
$("#main_menu li##{menuId}").addClass('active_menu_item')
clearContentArea: ->
$('div#content').children().remove()
console.log [
foo: 1
,
bar: 2
]
for f, index in files
extname = path.extname f
fs.lstat f, (err, stats) ->
if !stats.isDirectory() and extname is '.coffee'
fs.readFile f, 'utf8', compileCallback
else if stats.isDirectory()
readDirAfterThisOne = ->
if index is files.length - 1 then clearInterval(h) and processDir(f)
h = setInterval readDirAfterThisOne, 50
if a
###
b
###
else
c
this.set({status: status});
this.trigger("change:status", this, status);
class Utilities
@findPos: (obj) ->
obj = obj.get(0) if obj.html?
left = top = 0
measure = ->
left += obj.offsetLeft
top += obj.offsetTop
measure()
measure() while obj = obj.offsetParent
getstyles ->
result = {}
for key in arguments
result[key] = this.getStyle(key)
return result
assert.deepEqual item, {
x: 1
y: 2
}
# Or:
assert.deepEqual item,
class ViewModel
firstName: ko.observable 'Bob'
lastName: ko.observable 'Smith'
constructor:
names = -> @firstName() + ' ' + @lastName()
@fullName = ko.dependentObservable names, this