Your SlideShare is downloading. ×
0
CoffeeScriptMike SilvisHungry Academy Class of 2012
CoffeeScript   Mike Silvis   Hungry Academy Class of 2012@MIKESILVIS       MIKESILVIS   MIKE.SILVIS   MIKE-SILVIS   MIKE.S...
RAILS ASSET PIPELINE
var cubes, list, math, num, number,  opposite, race, square,   __slice = [].slice; number = 42; JAVASCRIPT                ...
var cubes, list, math, num, number,  opposite, race, square,   __slice = [].slice; number = 42; JAVASCRIPT                ...
var cubes, list, math, num, number,                          # Assignment:  opposite, race, square,                       ...
var cubes, list, math, num, number,                          # Assignment:  opposite, race, square,                       ...
var cubes, list, math, num, number,                          # Assignment:  opposite, race, square,                       ...
var cubes, list, math, num, number,                             # Assignment:  opposite, race, square,                    ...
var cubes, list, math, num, number,                             # Assignment:  opposite, race, square,                    ...
var cubes, list, math, num, number,                             # Assignment:  opposite, race, square,                    ...
var cubes, list, math, num, number,                             # Assignment:  opposite, race, square,                    ...
var cubes, list, math, num, number,                             # Assignment:  opposite, race, square,                    ...
var cubes, list, math, num, number,                             # Assignment:  opposite, race, square,                    ...
var cubes, list, math, num, number,                               # Assignment:  opposite, race, square,                  ...
alert "What about using jQuery?"
jQuery(function() {  return $("p").click(function() {    return $(this).slideUp();  });});   JQUERY CLICK FUNCTIONJQUERY I...
jQuery(function() {                  jQuery ->  return $("p").click(function() {       $("p").click ->    return $(this).s...
jQuery ->  coffee:    $(".points").click ->      alert Math.floor((Math.random()*100)+1) + " Points achieved!"COFFEE IN YO...
HTTP://JS2COFFEE.ORG/USEFUL RESOURCES
HTTP://COFFEESCRIPT.ORG/COFFEESCRIPT.ORG
Upcoming SlideShare
Loading in...5
×

Coffee Script

849

Published on

A lighting talk on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
849
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript of "Coffee Script"

    1. 1. CoffeeScriptMike SilvisHungry Academy Class of 2012
    2. 2. CoffeeScript Mike Silvis Hungry Academy Class of 2012@MIKESILVIS MIKESILVIS MIKE.SILVIS MIKE-SILVIS MIKE.SILVIS@
    3. 3. RAILS ASSET PIPELINE
    4. 4. var cubes, list, math, num, number, opposite, race, square, __slice = [].slice; number = 42; JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    5. 5. var cubes, list, math, num, number, opposite, race, square, __slice = [].slice; number = 42; JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    6. 6. var cubes, list, math, num, number, # Assignment: opposite, race, square, number = 42 __slice = [].slice; opposite = true number = 42; JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    7. 7. var cubes, list, math, num, number, # Assignment: opposite, race, square, number = 42 __slice = [].slice; opposite = true number = 42; if (opposite) { number = -42; } JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    8. 8. var cubes, list, math, num, number, # Assignment: opposite, race, square, number = 42 __slice = [].slice; opposite = true number = 42; if (opposite) { number = -42; } JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    9. 9. var cubes, list, math, num, number, # Assignment: opposite, race, square, number = 42 __slice = [].slice; opposite = true number = 42; if (opposite) { number = -42; # Conditions: } number = -42 if opposite JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    10. 10. var cubes, list, math, num, number, # Assignment: opposite, race, square, number = 42 __slice = [].slice; opposite = true number = 42; if (opposite) { number = -42; # Conditions: } number = -42 if oppositesquare = function(x) { return x * x;}; JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    11. 11. var cubes, list, math, num, number, # Assignment: opposite, race, square, number = 42 __slice = [].slice; opposite = true number = 42; if (opposite) { number = -42; # Conditions: } number = -42 if oppositesquare = function(x) { return x * x;}; JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    12. 12. var cubes, list, math, num, number, # Assignment: opposite, race, square, number = 42 __slice = [].slice; opposite = true number = 42; if (opposite) { number = -42; # Conditions: } number = -42 if oppositesquare = function(x) { return x * x; # Functions:}; square = (x) -> x * x JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    13. 13. var cubes, list, math, num, number, # Assignment: opposite, race, square, number = 42 __slice = [].slice; opposite = true number = 42; if (opposite) { number = -42; # Conditions: } number = -42 if oppositesquare = function(x) { return x * x; # Functions:}; square = (x) -> x * xmath = { root: Math.sqrt, square: square, cube: function(x) { return x * square(x); }}; JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    14. 14. var cubes, list, math, num, number, # Assignment: opposite, race, square, number = 42 __slice = [].slice; opposite = true number = 42; if (opposite) { number = -42; # Conditions: } number = -42 if oppositesquare = function(x) { return x * x; # Functions:}; square = (x) -> x * xmath = { root: Math.sqrt, square: square, cube: function(x) { return x * square(x); }}; JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    15. 15. var cubes, list, math, num, number, # Assignment: opposite, race, square, number = 42 __slice = [].slice; opposite = true number = 42; if (opposite) { number = -42; # Conditions: } number = -42 if oppositesquare = function(x) { return x * x; # Functions:}; square = (x) -> x * xmath = { root: Math.sqrt, # Objects: square: square, math = cube: function(x) { root: Math.sqrt return x * square(x); square: square } cube: (x) -> x * square x}; JAVASCRIPT COFFEESCRIPTCOFFEESCRIPT IS A CLEAN JAVASCRIPTIT TAKES JAVASCRIPT AND TURNS IT INTO MORE RUBY LIKE SYNTAX
    16. 16. alert "What about using jQuery?"
    17. 17. jQuery(function() { return $("p").click(function() { return $(this).slideUp(); });}); JQUERY CLICK FUNCTIONJQUERY IS ALL THE SAME!!!ONLY CLEANER!
    18. 18. jQuery(function() { jQuery -> return $("p").click(function() { $("p").click -> return $(this).slideUp(); $(this).slideUp() });}); JQUERY CLICK FUNCTION COFFEE CLICKJQUERY IS ALL THE SAME!!!ONLY CLEANER!
    19. 19. jQuery -> coffee: $(".points").click -> alert Math.floor((Math.random()*100)+1) + " Points achieved!"COFFEE IN YOUR VIEWS!WITH SLIM
    20. 20. HTTP://JS2COFFEE.ORG/USEFUL RESOURCES
    21. 21. HTTP://COFFEESCRIPT.ORG/COFFEESCRIPT.ORG
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×