Skip to content

Instantly share code, notes, and snippets.

@geraudmathe
Created August 13, 2013 10:30
Show Gist options
  • Save geraudmathe/6219926 to your computer and use it in GitHub Desktop.
Save geraudmathe/6219926 to your computer and use it in GitHub Desktop.
# COFFEE
@func
# JS
this.func
# COFFEE
@func()
# JS
this.func()
# COFFEE
@func
param1: "string"
# JS
this.func({
param1: "string"
})
#coffee
my_hash =
param1: "value1"
param2: "value2"
#javascript
my_hash = {
param1: "value1",
param2: "value2"
}
#coffee
a_function_name = ->
alert "something"
#JS
a_function_name = function(){
alert("something");
}
#coffee
a_function_name = ->
alert "something"
#JS
a_function_name = function(){
}
alert("something");
#coffee
a_function_name ->
alert "something"
#JS
a_function_name(function(){
})
alert("something");
#coffee
a_value = "booh"
"something #{a_value}"
#js
var a_value = "booh";
"something"+ a_value;
#coffee
a_func = ->
@
another_func =>
@func()
this
#js
a_func = function(){
_this = this;
another_func(function(){
_this.func()
this.func()
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment