Skip to content

Instantly share code, notes, and snippets.

@simon-lang
Created July 27, 2012 06:33
Show Gist options
  • Select an option

  • Save simon-lang/3186474 to your computer and use it in GitHub Desktop.

Select an option

Save simon-lang/3186474 to your computer and use it in GitHub Desktop.
Learning Coffeescript
a = 12
Pimptown = {}
Pimptown.Calculator =
$el: null
init: ->
this.$el = $('#output')
sqrt: (x) ->
x*x
print: ->
this.$el.html(this.sqrt(a))
$(document).ready ->
Pimptown.Calculator.init()
Pimptown.Calculator.print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment