Coffee Script
Upcoming SlideShare
Loading in...5
×
 

Coffee Script

on

  • 985 views

A lighting talk on

A lighting talk on

Statistics

Views

Total Views
985
Views on SlideShare
985
Embed Views
0

Actions

Likes
0
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Coffee Script Coffee Script Presentation Transcript

  • CoffeeScriptMike SilvisHungry Academy Class of 2012
  • CoffeeScript Mike Silvis Hungry Academy Class of 2012@MIKESILVIS MIKESILVIS MIKE.SILVIS MIKE-SILVIS MIKE.SILVIS@
  • RAILS ASSET PIPELINE
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • alert "What about using jQuery?"
  • jQuery(function() { return $("p").click(function() { return $(this).slideUp(); });}); JQUERY CLICK FUNCTIONJQUERY IS ALL THE SAME!!!ONLY CLEANER!
  • 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!
  • jQuery -> coffee: $(".points").click -> alert Math.floor((Math.random()*100)+1) + " Points achieved!"COFFEE IN YOUR VIEWS!WITH SLIM
  • HTTP://JS2COFFEE.ORG/USEFUL RESOURCES
  • HTTP://COFFEESCRIPT.ORG/COFFEESCRIPT.ORG