0
One Man                         Lightning Talks                         An opportunity to witness disaster                ...
Do Your Commit                        Messages Suck?                               Ryan McGeary                          h...
The             BadMonday, April 4, 2011
Bad   587a09c   dfe4c3e   9770886   7587f8b   9052cb8   8af6da0   0536fc7   d5e07c7   0328c7c   3ee25cd   c3f7275   9f474b...
More Bad    8b48352    3a61755    bf77372    eec60db             this isstupid                                a fucking   ...
Again Bad    18c3f84             Huge commitMonday, April 4, 2011
Huge Whoops More Again                           Serious Hassle Bad    c1c38fc               Update deploy                ...
The      GoodMonday, April 4, 2011
Good    0835022             Updated basic                        auth prompt to                        reflect app nameMon...
Good    950b8de    0835022              Updated basic                        Fixed password reset for                     ...
More Good    3224fff Added an extra 10s while sleeping            after a Twitter rate-limit error                        ...
More Good    334a2c4 Fixed bug related to contact syncing            [#9190663]                        Contacts that shoul...
Template                              Ya generic                          AR#6375]    Moved all static pages into         ...
Template    Moved all static pages N           B                 T a generic                        E into     VE  R      ...
Verbs                        184   Added                         85   Fixed                         76   Upped            ...
“Vendor Everything”        Ryan McGeary                        http://ryan.mcgeary.org      Still Applies            @rmm5...
ge ms              em                           r/              ig   .g                en      do              nf         ...
WHY?Monday, April 4, 2011
Check in your                           .rvmrc                        rvm ruby-1.9.2Monday, April 4, 2011
RVM Gemsets                        Are OverratedMonday, April 4, 2011
Let Bundler Follow the                              --path    $ bundle install --path vendor    $ echo vendor/ruby >> .git...
Package Your Gems in                         vendor/cache                        $ bundle packageMonday, April 4, 2011
Help!    alias               b="bundle"    alias               bi="b install --path vendor"    alias               bu="b u...
Summary    $ bundle install --path vendor    $ bundle package    $ echo vendor/ruby >> .gitignoreMonday, April 4, 2011
CoffeeScript       A little language that compiles into JavaScript                             Ryan McGeary               ...
Jeremy Ashkenas               JavaScripts less           ostentatious kid brother CoffeeScript is                         ...
if (typeof elvis !== "undefined" && elvis !== null) {      alert("I knew it!");    }Monday, April 4, 2011
alert "I knew it!" if elvis?Monday, April 4, 2011
var cube, square;                        square = function(x) {                           return x * x;                   ...
square = (x) -> x * x                    cube   = (x) -> square(x) * xMonday, April 4, 2011
var _i, _len, _ref, _result, food, lunch;             lunch = (function() {               _result = []; _ref = [toast, che...
lunch = (eat food for food in [toast, cheese, wine])Monday, April 4, 2011
var _i, _j, _len, _len2, _ref, _ref2, roid, roid2;        _ref = asteroids;        for (_i = 0, _len = _ref.length; _i < _...
for roid in asteroids               for roid2 in asteroids when roid isnt roid2                 roid.explode() if roid.ove...
Installation  $ brew install node  $ curl http://npmjs.org/install.sh | sh  # Add /usr/local/share/npm/bin to PATH  $ npm ...
Usage              $ coffee -c path/to/script.coffee              $ coffee --watch experimental.coffee              $ coff...
Significant Whitespace                        if happy and knowsIt                          clapsHands()                  ...
Significant Whitespace                        if (happy && knowsIt) {                          clapsHands();              ...
Functions                 square = (x) -> x * x                 area   = (x, y) -> x * y                 noop   = ->Monday...
Functions                        var area, noop, square;                        square = function(x) {                    ...
Objects                                         var kids;                kids =                   kids = {                ...
Lexical Scoping / Variable Safety                                        (function() {                                    ...
OOP                class Animal                  constructor: (@name) ->                        move: (meters) ->         ...
OOP                var Animal, Snake, sam;                var __extends = function(child, parent) {                      v...
Pattern Matching                 theBait   = 1000                 theSwitch = 0                 [theBait, theSwitch] = [th...
Pattern Matching               var _ref, forecast, temp, theBait, theSwitch, weatherReport, zip;               theBait = 1...
String and RegExp Interpolation                 quote = "A picture is a fact."                 author = "Wittgenstein"    ...
String and RegExp Interpolation                var author, dates, phrase, quote, sentence, sep;                quote = "A ...
Array and Object Comprehensions                 foods = [toast, cheese, wine]                 lunch = (eat(food) for food ...
Array and Object Comprehensions                var _i, _len, _ref, _result, age, ages, child, food, foods, lunch, yearsOld...
Function Binding          Account = (customer, cart) ->            @customer = customer            @cart = cart           ...
Function Binding                var Account;                var __bind = function(func, context) {                      re...
The Rest...                        Slicing and Splicing                        Splat Arguments                        Exis...
Ideas for Getting StartedMonday, April 4, 2011
How We Use           MongoDB          at BusyConf                Making great            conferences even better          ...
Monday, April 4, 2011
Why MongoDB?Monday, April 4, 2011
Why NOT MongoDB?Monday, April 4, 2011
Event                           Day 1      Day 2     Day 3              Track 1 Track 2 Track 3 TimeSlot 1      TimeSlot 1...
Events               Days                                          1..N                                  o n?             ...
Event               Day 1                        Day 1               Track 1                      Track 1                T...
Event                         Day 1        Day 2        Day n...                         Track 1      Track 2      Track n...
HTML5     Application      Caching       There are only two hard     things in Computer Science:         cache invalidatio...
diveintohtml5.orgMonday, April 4, 2011
Browser SupportMonday, April 4, 2011
Cache Manifest    <!DOCTYPE HTML>    <html manifest="/mobile.manifest">    <body>    ...    </body>    </html>            ...
CACHE Sections    CACHE MANIFEST    http://www.google-analytics.com/ga.js    /favicon.ico    /javascripts/application.js  ...
NETWORK Sections    CACHE MANIFEST    NETWORK:    *    CACHE:    http://www.google-analytics.com/ga.js    /favicon.ico    ...
FALLBACK Sections    CACHE MANIFEST    FALLBACK:    / /offline.html    NETWORK:    *    CACHE:    http://www.google-analyt...
Expiring The Cache    CACHE MANIFEST    # Updated: <%= something.updated_at %>    # Released: <%= application_released_at ...
window.applicationCache           checking                                      error              updated          NO    ...
Ryan McGeary      ryan.mcgeary.org    @rmm5t    ryan@mcgeary.org         McGeary Consulting GroupMonday, April 4, 2011
Attributions           http://jashkenas.github.com/coffee-script/              http://www.flickr.com/photos/grebo_guru/138...
Upcoming SlideShare
Loading in...5
×

One Man Lightning Talks

1,478

Published on

To celebrate the NovaRUG's 50th meeting, they opened the floor to lightning talks. As an added incentive, the highest voted lightning talk was to be given a speaking slot at RubyNation 2011. I guess bringing my friends and family paid off that day. In
the spirit of that event, I gave back-to-back lightning talks on a wide range of
topics, including:

* Do Your Commit Messages Suck?
* "Vendor Everything" Still Applies
* CoffeeScript: Exposing the Good Parts of JavaScript with Better Syntax
* How We Use MongoDB at BusyConf
* HTML5 Application Caching

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
1,478
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "One Man Lightning Talks"

  1. 1. One Man Lightning Talks An opportunity to witness disaster Ryan McGeary http://ryan.mcgeary.org @rmm5t Bill BrookmanShowman ExtraordinaireMonday, April 4, 2011
  2. 2. Do Your Commit Messages Suck? Ryan McGeary http://ryan.mcgeary.org @rmm5tMonday, April 4, 2011
  3. 3. The BadMonday, April 4, 2011
  4. 4. Bad 587a09c dfe4c3e 9770886 7587f8b 9052cb8 8af6da0 0536fc7 d5e07c7 0328c7c 3ee25cd c3f7275 9f474bc 8a0f74c dffb0db 0841841 19900ba e5a524a af0a3bb deploymoreenvcap Stagingscript g Working? whoops again Read from Updated scripts Againfixed More staging cleanup file staging setup fixesMonday, April 4, 2011
  5. 5. More Bad 8b48352 3a61755 bf77372 eec60db this isstupid a fucking what a hassle seriously a fucking hassle hassleMonday, April 4, 2011
  6. 6. Again Bad 18c3f84 Huge commitMonday, April 4, 2011
  7. 7. Huge Whoops More Again Serious Hassle Bad c1c38fc Update deploy recipe with some stuff. I dunno. its lateMonday, April 4, 2011
  8. 8. The GoodMonday, April 4, 2011
  9. 9. Good 0835022 Updated basic auth prompt to reflect app nameMonday, April 4, 2011
  10. 10. Good 950b8de 0835022 Updated basic Fixed password reset for users who use the same authonprompt accounts email multiple to [Fixes #11102389] name reflect appMonday, April 4, 2011
  11. 11. More Good 3224fff Added an extra 10s while sleeping after a Twitter rate-limit error * Twitter isnt always ready immediately after sleeping the advertised amount of time.Monday, April 4, 2011
  12. 12. More Good 334a2c4 Fixed bug related to contact syncing [#9190663] Contacts that should have been tagged both friend and 3224fff Added an extra 10s while sleeping follower were having those tags toggled on each after a Twitter rate-limit error #profile_sync run. If the contact had "follower", and ready * Twitter isnt always profile_sync was immediately after sleeping the run, then the code would set the system_tags to advertised amount of time. ["following"], blowing away the "follower" tag. It would do the same thing vice versa for the "following" system tag.Monday, April 4, 2011
  13. 13. Template Ya generic AR#6375] Moved all static pages into M M PagesController [Finishes SU I S * Cleaned up the routes Lpage creation * Simplified TA static DEMonday, April 4, 2011
  14. 14. Template Moved all static pages N B T a generic E into VE R M # FR A [Finishes #6375]ET PagesController G CK * Cleaned up the routes TI HY * Simplified static page creation WMonday, April 4, 2011
  15. 15. Verbs 184 Added 85 Fixed 76 Upped 31 Removed 24 Switched 21 Improved 20 Updated 16 RenamedMonday, April 4, 2011
  16. 16. “Vendor Everything” Ryan McGeary http://ryan.mcgeary.org Still Applies @rmm5tMonday, April 4, 2011
  17. 17. ge ms em r/ ig .g en do nf v coMonday, April 4, 2011
  18. 18. WHY?Monday, April 4, 2011
  19. 19. Check in your .rvmrc rvm ruby-1.9.2Monday, April 4, 2011
  20. 20. RVM Gemsets Are OverratedMonday, April 4, 2011
  21. 21. Let Bundler Follow the --path $ bundle install --path vendor $ echo vendor/ruby >> .gitignoreMonday, April 4, 2011
  22. 22. Package Your Gems in vendor/cache $ bundle packageMonday, April 4, 2011
  23. 23. Help! alias b="bundle" alias bi="b install --path vendor" alias bu="b update" alias be="b exec" alias binit="bi && b package && echo vendor/ruby >> .gitignore"Monday, April 4, 2011
  24. 24. Summary $ bundle install --path vendor $ bundle package $ echo vendor/ruby >> .gitignoreMonday, April 4, 2011
  25. 25. CoffeeScript A little language that compiles into JavaScript Ryan McGeary http://ryan.mcgeary.org @rmm5tMonday, April 4, 2011
  26. 26. Jeremy Ashkenas JavaScripts less ostentatious kid brother CoffeeScript is an attempt to one-to-one expose the good with JavaScript parts of JavaScript in a better simple way. functional syntax compiles to the good partshttp://jashkenas.github.com/coffee-script/Monday, April 4, 2011
  27. 27. if (typeof elvis !== "undefined" && elvis !== null) { alert("I knew it!"); }Monday, April 4, 2011
  28. 28. alert "I knew it!" if elvis?Monday, April 4, 2011
  29. 29. var cube, square; square = function(x) { return x * x; }; cube = function(x) { return square(x) * x; };Monday, April 4, 2011
  30. 30. square = (x) -> x * x cube = (x) -> square(x) * xMonday, April 4, 2011
  31. 31. var _i, _len, _ref, _result, food, lunch; lunch = (function() { _result = []; _ref = [toast, cheese, wine]; for (_i = 0, _len = _ref.length; _i < _len; _i++) { food = _ref[_i]; _result.push(eat(food)); } return _result; })();Monday, April 4, 2011
  32. 32. lunch = (eat food for food in [toast, cheese, wine])Monday, April 4, 2011
  33. 33. var _i, _j, _len, _len2, _ref, _ref2, roid, roid2; _ref = asteroids; for (_i = 0, _len = _ref.length; _i < _len; _i++) { roid = _ref[_i]; _ref2 = asteroids; for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { roid2 = _ref2[_j]; if (roid !== roid2) { if (roid.overlaps(roid2)) { roid.explode(); } } } }Monday, April 4, 2011
  34. 34. for roid in asteroids for roid2 in asteroids when roid isnt roid2 roid.explode() if roid.overlaps roid2Monday, April 4, 2011
  35. 35. Installation $ brew install node $ curl http://npmjs.org/install.sh | sh # Add /usr/local/share/npm/bin to PATH $ npm install coffee-scriptMonday, April 4, 2011
  36. 36. Usage $ coffee -c path/to/script.coffee $ coffee --watch experimental.coffee $ coffee --print *.coffee > all.jsMonday, April 4, 2011
  37. 37. Significant Whitespace if happy and knowsIt clapsHands() chaChaCha() else showIt()Monday, April 4, 2011
  38. 38. Significant Whitespace if (happy && knowsIt) { clapsHands(); chaChaCha(); } else { showIt(); }Monday, April 4, 2011
  39. 39. Functions square = (x) -> x * x area = (x, y) -> x * y noop = ->Monday, April 4, 2011
  40. 40. Functions var area, noop, square; square = function(x) { return x * x; }; area = function(x, y) { return x * y; }; noop = function() {};Monday, April 4, 2011
  41. 41. Objects var kids; kids = kids = { brother: brother: { name: "Max", >> name: "Max" age: 11 age: 11 }, sister: { sister: name: "Ida", name: "Ida" age: 9 } age: 9 };Monday, April 4, 2011
  42. 42. Lexical Scoping / Variable Safety (function() { var change, inner, outer; outer = 1 outer = 1; change = -> >> change = function() { var inner; inner = -1 inner = -1; outer = 10 return (outer = 10); }; inner = change() inner = change(); }).call(this);Monday, April 4, 2011
  43. 43. OOP class Animal constructor: (@name) -> move: (meters) -> alert @name + " moved " + meters + "m." class Snake extends Animal move: -> alert "Slithering..." super 5 sam = new Snake "Sammy the Python" sam.move()Monday, April 4, 2011
  44. 44. OOP var Animal, Snake, sam; var __extends = function(child, parent) { var ctor = function(){}; ctor.prototype = parent.prototype; child.prototype = new ctor(); child.prototype.constructor = child; if (typeof parent.extended === "function") parent.extended(child); child.__super__ = parent.prototype; }; Animal = function(_arg) { this.name = _arg; return this; }; Animal.prototype.move = function(meters) { return alert(this.name + " moved " + meters + "m."); }; Snake = function() { return Animal.apply(this, arguments); }; __extends(Snake, Animal); Snake.prototype.move = function() { alert("Slithering..."); return Snake.__super__.move.call(this, 5); }; sam = new Snake("Sammy the Python"); sam.move();Monday, April 4, 2011
  45. 45. Pattern Matching theBait = 1000 theSwitch = 0 [theBait, theSwitch] = [theSwitch, theBait] weatherReport = (location) -> [location, 72, "Mostly Sunny"] [zip, temp, forecast] = weatherReport "20175Monday, April 4, 2011
  46. 46. Pattern Matching var _ref, forecast, temp, theBait, theSwitch, weatherReport, zip; theBait = 1000; theSwitch = 0; _ref = [theSwitch, theBait]; theBait = _ref[0]; theSwitch = _ref[1]; weatherReport = function(location) { return [location, 72, "Mostly Sunny"]; }; _ref = weatherReport("20175"); zip = _ref[0]; temp = _ref[1]; forecast = _ref[2];Monday, April 4, 2011
  47. 47. String and RegExp Interpolation quote = "A picture is a fact." author = "Wittgenstein" phrase = "#{quote} -- #{author}" sentence = "#{ 22 / 7 } approximates π" sep = "[./- ]" dates = /d+#{sep}d+#{sep}d+/gMonday, April 4, 2011
  48. 48. String and RegExp Interpolation var author, dates, phrase, quote, sentence, sep; quote = "A picture is a fact."; author = "Wittgenstein"; phrase = ("" + (quote) + " -- " + (author)); sentence = ("" + (22 / 7) + " is a decent approximation of π"); sep = "[./- ]"; dates = (new RegExp("d+" + (sep) + "d+" + (sep) + "d+", "g"));Monday, April 4, 2011
  49. 49. Array and Object Comprehensions foods = [toast, cheese, wine] lunch = (eat(food) for food in foods) yearsOld = max: 10, ida: 9, tim: 11 ages = for child, age of yearsOld "#{child} is #{age}"Monday, April 4, 2011
  50. 50. Array and Object Comprehensions var _i, _len, _ref, _result, age, ages, child, food, foods, lunch, yearsOld; var __hasProp = Object.prototype.hasOwnProperty; foods = [toast, cheese, wine]; lunch = (function() { _result = []; _ref = foods; for (_i = 0, _len = _ref.length; _i < _len; _i++) { food = _ref[_i]; _result.push(eat(food)); } return _result; })(); yearsOld = { max: 10, ida: 9, tim: 11 }; ages = (function() { _result = []; _ref = yearsOld; for (child in _ref) { if (!__hasProp.call(_ref, child)) continue; age = _ref[child]; _result.push("" + (child) + " is " + (age)); } return _result; })();Monday, April 4, 2011
  51. 51. Function Binding Account = (customer, cart) -> @customer = customer @cart = cart $(#checkout).bind click, (event) => @customer.purchase @cartMonday, April 4, 2011
  52. 52. Function Binding var Account; var __bind = function(func, context) { return function(){ return func.apply(context, arguments); }; }; Account = function(customer, cart) { this.customer = customer; this.cart = cart; return $(#checkout).bind(click, __bind(function(event) { return this.customer.purchase(this.cart); }, this)); };Monday, April 4, 2011
  53. 53. The Rest... Slicing and Splicing Splat Arguments Existential Operator Everything is an expression; always a return value Pattern matching with object literals Switch/When/Else While/Until/Loop Try/Catch/Finally Chained comparison Multiline Strings, Heredocs, and Block Comments http://jashkenas.github.com/coffee-script/Monday, April 4, 2011
  54. 54. Ideas for Getting StartedMonday, April 4, 2011
  55. 55. How We Use MongoDB at BusyConf Making great conferences even better busyconf.com Ryan McGeary Jim GarvinMonday, April 4, 2011
  56. 56. Monday, April 4, 2011
  57. 57. Why MongoDB?Monday, April 4, 2011
  58. 58. Why NOT MongoDB?Monday, April 4, 2011
  59. 59. Event Day 1 Day 2 Day 3 Track 1 Track 2 Track 3 TimeSlot 1 TimeSlot 1 TS 2 TS 3 Activity Activity Activity Activity Speaker Speaker 1 S2 S3Monday, April 4, 2011
  60. 60. Events Days 1..N o n? i ti Tracks 1..N pos 1..N 1..N TimeSlots 1..1 Activities T A? DA 1..N A ET Links 1..N Speakers MMonday, April 4, 2011
  61. 61. Event Day 1 Day 1 Track 1 Track 1 TimeSlot 1 TimeSlot n TimeSlot 1 TimeSlo Activity Activity Activity tActivit n S1 Sn Speaker S1 Sn y Speak er Track n Track n TimeSlot 1 TimeSlot 1 Activity Activity Speaker Speaker TimeSlot n TimeSlot nMonday, April 4, 2011
  62. 62. Event Day 1 Day 2 Day n... Track 1 Track 2 Track n... TimeSlot 1 TimeSlot 2 TimeSlot n... Activity SpeakerMonday, April 4, 2011
  63. 63. HTML5 Application Caching There are only two hard things in Computer Science: cache invalidation and naming things. -- Phil Karlton Ryan McGeary http://ryan.mcgeary.org @rmm5tMonday, April 4, 2011
  64. 64. diveintohtml5.orgMonday, April 4, 2011
  65. 65. Browser SupportMonday, April 4, 2011
  66. 66. Cache Manifest <!DOCTYPE HTML> <html manifest="/mobile.manifest"> <body> ... </body> </html> text/cache-manifestMonday, April 4, 2011
  67. 67. CACHE Sections CACHE MANIFEST http://www.google-analytics.com/ga.js /favicon.ico /javascripts/application.js /stylesheets/screen.css /data.jsonMonday, April 4, 2011
  68. 68. NETWORK Sections CACHE MANIFEST NETWORK: * CACHE: http://www.google-analytics.com/ga.js /favicon.ico /javascripts/application.js /stylesheets/screen.css /data.jsonMonday, April 4, 2011
  69. 69. FALLBACK Sections CACHE MANIFEST FALLBACK: / /offline.html NETWORK: * CACHE: http://www.google-analytics.com/ga.js /favicon.icoMonday, April 4, 2011
  70. 70. Expiring The Cache CACHE MANIFEST # Updated: <%= something.updated_at %> # Released: <%= application_released_at %> NETWORK: * CACHE: # ...Monday, April 4, 2011
  71. 71. window.applicationCache checking error updated NO manifest? noupdate YES downloading progress swapCache() NO already YES cached cached? updatereadyMonday, April 4, 2011
  72. 72. Ryan McGeary ryan.mcgeary.org @rmm5t ryan@mcgeary.org McGeary Consulting GroupMonday, April 4, 2011
  73. 73. Attributions http://jashkenas.github.com/coffee-script/ http://www.flickr.com/photos/grebo_guru/13864695/ http://www.flickr.com/photos/74234765@N00/488955057/ http://www.flickr.com/photos/span112/2245983695/ http://www.flickr.com/photos/adunne/3974874247/ http://www.flickr.com/photos/bigkurt/4425700131/ http://www.flickr.com/photos/28111377@N07/2970550798/ http://www.flickr.com/photos/7678790@N06/3380560365/ http://www.zazzle.com/html5_t_shirt-235389073464260795 http://www.flickr.com/photos/40775750@N00/531138641/ http://www.flickr.com/photos/86176561@N00/492795782/ http://www.flickr.com/photos/princesstheater/3530252342 http://www.flickr.com/photos/77555797@N00/133942287/ http://www.flickr.com/photos/littlegreenfroggy/2806572646 http://www.flickr.com/photos/34580986@N03/4985041197/ http://www.flickr.com/photos/raster/3563135804 http://www.flickr.com/photos/83275741@N00/291831432/ http://www.flickr.com/photos/mwichary/2290328252/ http://www.flickr.com/photos/58115002@N00/3283033324/ http://www.flickr.com/photos/37996583811@N01/2443301175/ http://www.flickr.com/photos/15133799@N02/3339157498/ http://www.flickr.com/photos/revdancatt/435273886/ http://www.flickr.com/photos/17731548@N00/981372736/ http://www.flickr.com/photos/7576193@N07/2476397335/ http://www.flickr.com/photos/48553010@N00/408767516/ http://www.free-computer-wallpapers.com/pictures/ Television_wallpaper/Alias_2 http://www.flickr.com/photos/44742295@N00/3998772594/ http://www.flickr.com/photos/79659919@N00/3413379549/ http://www.flickr.com/photos/82402200@N00/523497824/Monday, April 4, 2011
  1. A particular slide catching your eye?

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

×