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
1 is 1 | |
# true | |
1 is "1" | |
# false |
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
bundle exec guard |
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
# Guardfile | |
group 'frontend' do | |
guard 'coffeescript', :output => 'public/javascripts/compiled' do | |
watch(%r{^app/coffeescripts/.+\.coffee$}) | |
end | |
end |
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
# Gemfile: | |
group :development do | |
gem 'guard' | |
gem 'guard-coffeescript' | |
end |
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
window.Animal = class Animal | |
window.Dog = class Dog extends Animal | |
# convention pour une constante mais utilise var | |
STATES = ["sleeping", "eating"] | |
constructor: -> | |
# appelle le constructeur d'Animal | |
super |
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
registerEvents = (node) -> | |
node.bind "click", (event) => | |
# this est bindé sur le this avant l'appel et non sur l'event |
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
setAttribute = (@attribute) -> |
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
setAttribute = (attribute) -> @attribute = attribute |
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
person = { firstname: "Martin", lastname: "Catty" } | |
person.introduce = -> console.log "Bonjour, je suis #{@firstname} #{@lastname}." | |
person.introduce() | |
# Bonjour, je suis Martin Catty. |
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
window.App = class App |