SlideShare ist ein Scribd-Unternehmen logo
1 von 73
Downloaden Sie, um offline zu lesen
One Man
                         Lightning Talks
                         An opportunity to witness disaster



                                  Ryan McGeary
                             http://ryan.mcgeary.org
                                    @rmm5t

   Bill Brookman
Showman Extraordinaire


Monday, April 4, 2011
Do Your Commit
                        Messages Suck?

                               Ryan McGeary
                          http://ryan.mcgeary.org
                                 @rmm5t




Monday, April 4, 2011
The
             Bad


Monday, April 4, 2011
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
                        fixes



Monday, April 4, 2011
More Bad

    8b48352
    3a61755
    bf77372
    eec60db             this isstupid
                                a fucking
                        what a hassle
                        seriously a
                        fucking
                        hassle hassle



Monday, April 4, 2011
Again Bad

    18c3f84             Huge commit




Monday, April 4, 2011
Huge Whoops More Again
                           Serious Hassle Bad
    c1c38fc               Update deploy
                          recipe with some
                          stuff. I dunno.
                          it's late

Monday, April 4, 2011
The
      Good


Monday, April 4, 2011
Good

    0835022             Updated basic
                        auth prompt to
                        reflect app name


Monday, April 4, 2011
Good

    950b8de
    0835022              Updated basic
                        Fixed password reset for
                        users who use the same
                         authonprompt accounts
                        email    multiple  to
                        [Fixes #11102389] name
                         reflect app


Monday, April 4, 2011
More Good
    3224fff Added an extra 10s while sleeping
            after a Twitter rate-limit error

                        * Twitter isn't always ready
                          immediately after sleeping the
                          advertised amount of time.




Monday, April 4, 2011
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 isn't 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
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
            DE


Monday, April 4, 2011
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
          W


Monday, April 4, 2011
Verbs
                        184   Added
                         85   Fixed
                         76   Upped
                         31   Removed
                         24   Switched
                         21   Improved
                         20   Updated
                         16   Renamed

Monday, April 4, 2011
“Vendor Everything”        Ryan McGeary
                        http://ryan.mcgeary.org
      Still Applies            @rmm5t




Monday, April 4, 2011
ge ms              em
                           r/              ig   .g
                en      do              nf
              v                    co
Monday, April 4, 2011
WHY?
Monday, April 4, 2011
Check in your
                           .rvmrc

                        rvm ruby-1.9.2



Monday, April 4, 2011
RVM Gemsets
                        Are Overrated

Monday, April 4, 2011
Let Bundler Follow the
                              --path
    $ bundle install --path vendor
    $ echo 'vendor/ruby' >> .gitignore




Monday, April 4, 2011
Package Your Gems in
                         vendor/cache

                        $ bundle package



Monday, April 4, 2011
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
Summary

    $ bundle install --path vendor
    $ bundle package
    $ echo 'vendor/ruby' >> .gitignore




Monday, April 4, 2011
CoffeeScript
       A little language that compiles into JavaScript



                             Ryan McGeary
                        http://ryan.mcgeary.org
                               @rmm5t




Monday, April 4, 2011
Jeremy Ashkenas
               JavaScript's 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 parts


http://jashkenas.github.com/coffee-script/
Monday, April 4, 2011
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;
                        };
                        cube = function(x) {
                           return square(x) * x;
                        };




Monday, April 4, 2011
square = (x) -> x * x
                    cube   = (x) -> square(x) * x




Monday, April 4, 2011
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
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 < _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
for roid in asteroids
               for roid2 in asteroids when roid isnt roid2
                 roid.explode() if roid.overlaps roid2




Monday, April 4, 2011
Installation
  $ brew install node
  $ curl http://npmjs.org/install.sh | sh

  # Add /usr/local/share/npm/bin to PATH



  $ npm install coffee-script




Monday, April 4, 2011
Usage
              $ coffee -c path/to/script.coffee

              $ coffee --watch experimental.coffee

              $ coffee --print *.coffee > all.js




Monday, April 4, 2011
Significant Whitespace

                        if happy and knowsIt
                          clapsHands()
                          chaChaCha()
                        else
                          showIt()


Monday, April 4, 2011
Significant Whitespace

                        if (happy && knowsIt) {
                          clapsHands();
                          chaChaCha();
                        } else {
                          showIt();
                        }


Monday, April 4, 2011
Functions
                 square = (x) -> x * x

                 area   = (x, y) -> x * y

                 noop   = ->



Monday, April 4, 2011
Functions
                        var area, noop, square;
                        square = function(x) {
                           return x * x;
                        };
                        area = function(x, y) {
                           return x * y;
                        };
                        noop = function() {};


Monday, April 4, 2011
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
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
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
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
Pattern Matching
                 theBait   = 1000
                 theSwitch = 0

                 [theBait, theSwitch] = [theSwitch, theBait]




                 weatherReport = (location) ->
                   [location, 72, "Mostly Sunny"]

                 [zip, temp, forecast] = weatherReport "20175




Monday, April 4, 2011
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
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+/g




Monday, April 4, 2011
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
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
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
Function Binding

          Account = (customer, cart) ->
            @customer = customer
            @cart = cart

                 $('#checkout').bind 'click', (event) =>
                   @customer.purchase @cart




Monday, April 4, 2011
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
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
Ideas for Getting Started




Monday, April 4, 2011
How We Use
           MongoDB
          at BusyConf
                Making great
            conferences even better
                        busyconf.com
                        Ryan McGeary
                          Jim Garvin
Monday, April 4, 2011
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        TS 2   TS 3           Activity

         Activity Activity Activity Speaker

            Speaker 1   S2 S3
Monday, April 4, 2011
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      M

Monday, April 4, 2011
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 n

Monday, April 4, 2011
Event

                         Day 1        Day 2        Day n...


                         Track 1      Track 2      Track n...


                         TimeSlot 1   TimeSlot 2   TimeSlot n...




                           Activity                   Speaker

Monday, April 4, 2011
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
               @rmm5t
Monday, April 4, 2011
diveintohtml5.org




Monday, April 4, 2011
Browser Support




Monday, April 4, 2011
Cache Manifest
    <!DOCTYPE HTML>
    <html manifest="/mobile.manifest">
    <body>
    ...
    </body>
    </html>

                        text/cache-manifest

Monday, April 4, 2011
CACHE Sections
    CACHE MANIFEST
    http://www.google-analytics.com/ga.js
    /favicon.ico
    /javascripts/application.js
    /stylesheets/screen.css
    /data.json



Monday, April 4, 2011
NETWORK Sections
    CACHE MANIFEST

    NETWORK:
    *

    CACHE:
    http://www.google-analytics.com/ga.js
    /favicon.ico
    /javascripts/application.js
    /stylesheets/screen.css
    /data.json




Monday, April 4, 2011
FALLBACK Sections
    CACHE MANIFEST

    FALLBACK:
    / /offline.html

    NETWORK:
    *

    CACHE:
    http://www.google-analytics.com/ga.js
    /favicon.ico




Monday, April 4, 2011
Expiring The Cache
    CACHE MANIFEST
    # Updated: <%= something.updated_at %>
    # Released: <%= application_released_at %>

    NETWORK:
    *

    CACHE:
    # ...




Monday, April 4, 2011
window.applicationCache
           checking                                      error


              updated          NO
              manifest?              noupdate

                         YES

     downloading                     progress

                                                      swapCache()
                                NO    already   YES
                cached                cached?         updateready


Monday, April 4, 2011
Ryan McGeary
      ryan.mcgeary.org    @rmm5t    ryan@mcgeary.org




         McGeary Consulting Group

Monday, April 4, 2011
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

Weitere ähnliche Inhalte

Ähnlich wie One Man Lightning Talks

Doctrine In The Real World sflive2011 Paris
Doctrine In The Real World sflive2011 ParisDoctrine In The Real World sflive2011 Paris
Doctrine In The Real World sflive2011 Paris
Jonathan Wage
 
Caz &amp; Work Scope
Caz &amp; Work ScopeCaz &amp; Work Scope
Caz &amp; Work Scope
brettdillon
 
Inspiratiemiddag_Vincent_Everts_Finalist generatie_einstein_komt_eraan_07042011
Inspiratiemiddag_Vincent_Everts_Finalist generatie_einstein_komt_eraan_07042011Inspiratiemiddag_Vincent_Everts_Finalist generatie_einstein_komt_eraan_07042011
Inspiratiemiddag_Vincent_Everts_Finalist generatie_einstein_komt_eraan_07042011
Finalist - open IT oplossingen
 

Ähnlich wie One Man Lightning Talks (8)

Railsify your web development
Railsify your web developmentRailsify your web development
Railsify your web development
 
Doctrine In The Real World sflive2011 Paris
Doctrine In The Real World sflive2011 ParisDoctrine In The Real World sflive2011 Paris
Doctrine In The Real World sflive2011 Paris
 
Javascript Unit Testting (PHPBenelux 2011-05-04)
Javascript Unit Testting (PHPBenelux 2011-05-04)Javascript Unit Testting (PHPBenelux 2011-05-04)
Javascript Unit Testting (PHPBenelux 2011-05-04)
 
Caz &amp; Work Scope
Caz &amp; Work ScopeCaz &amp; Work Scope
Caz &amp; Work Scope
 
Intro to Micro-frameworks
Intro to Micro-frameworksIntro to Micro-frameworks
Intro to Micro-frameworks
 
Einstein finalist.nl
Einstein finalist.nlEinstein finalist.nl
Einstein finalist.nl
 
Inspiratiemiddag_Vincent_Everts_Finalist generatie_einstein_komt_eraan_07042011
Inspiratiemiddag_Vincent_Everts_Finalist generatie_einstein_komt_eraan_07042011Inspiratiemiddag_Vincent_Everts_Finalist generatie_einstein_komt_eraan_07042011
Inspiratiemiddag_Vincent_Everts_Finalist generatie_einstein_komt_eraan_07042011
 
Desacoplando aplicaciones
Desacoplando aplicacionesDesacoplando aplicaciones
Desacoplando aplicaciones
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

One Man Lightning Talks

  • 1. One Man Lightning Talks An opportunity to witness disaster Ryan McGeary http://ryan.mcgeary.org @rmm5t Bill Brookman Showman Extraordinaire Monday, April 4, 2011
  • 2. Do Your Commit Messages Suck? Ryan McGeary http://ryan.mcgeary.org @rmm5t Monday, April 4, 2011
  • 3. The Bad Monday, April 4, 2011
  • 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 fixes Monday, April 4, 2011
  • 5. More Bad 8b48352 3a61755 bf77372 eec60db this isstupid a fucking what a hassle seriously a fucking hassle hassle Monday, April 4, 2011
  • 6. Again Bad 18c3f84 Huge commit Monday, April 4, 2011
  • 7. Huge Whoops More Again Serious Hassle Bad c1c38fc Update deploy recipe with some stuff. I dunno. it's late Monday, April 4, 2011
  • 8. The Good Monday, April 4, 2011
  • 9. Good 0835022 Updated basic auth prompt to reflect app name Monday, April 4, 2011
  • 10. Good 950b8de 0835022 Updated basic Fixed password reset for users who use the same authonprompt accounts email multiple to [Fixes #11102389] name reflect app Monday, April 4, 2011
  • 11. More Good 3224fff Added an extra 10s while sleeping after a Twitter rate-limit error * Twitter isn't always ready immediately after sleeping the advertised amount of time. Monday, April 4, 2011
  • 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 isn't 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. 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 DE Monday, April 4, 2011
  • 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 W Monday, April 4, 2011
  • 15. Verbs 184 Added 85 Fixed 76 Upped 31 Removed 24 Switched 21 Improved 20 Updated 16 Renamed Monday, April 4, 2011
  • 16. “Vendor Everything” Ryan McGeary http://ryan.mcgeary.org Still Applies @rmm5t Monday, April 4, 2011
  • 17. ge ms em r/ ig .g en do nf v co Monday, April 4, 2011
  • 19. Check in your .rvmrc rvm ruby-1.9.2 Monday, April 4, 2011
  • 20. RVM Gemsets Are Overrated Monday, April 4, 2011
  • 21. Let Bundler Follow the --path $ bundle install --path vendor $ echo 'vendor/ruby' >> .gitignore Monday, April 4, 2011
  • 22. Package Your Gems in vendor/cache $ bundle package Monday, April 4, 2011
  • 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. Summary $ bundle install --path vendor $ bundle package $ echo 'vendor/ruby' >> .gitignore Monday, April 4, 2011
  • 25. CoffeeScript A little language that compiles into JavaScript Ryan McGeary http://ryan.mcgeary.org @rmm5t Monday, April 4, 2011
  • 26. Jeremy Ashkenas JavaScript's 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 parts http://jashkenas.github.com/coffee-script/ Monday, April 4, 2011
  • 27. if (typeof elvis !== "undefined" && elvis !== null) { alert("I knew it!"); } Monday, April 4, 2011
  • 28. alert "I knew it!" if elvis? Monday, April 4, 2011
  • 29. var cube, square; square = function(x) { return x * x; }; cube = function(x) { return square(x) * x; }; Monday, April 4, 2011
  • 30. square = (x) -> x * x cube = (x) -> square(x) * x Monday, April 4, 2011
  • 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. lunch = (eat food for food in ['toast', 'cheese', 'wine']) Monday, April 4, 2011
  • 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. for roid in asteroids for roid2 in asteroids when roid isnt roid2 roid.explode() if roid.overlaps roid2 Monday, April 4, 2011
  • 35. Installation $ brew install node $ curl http://npmjs.org/install.sh | sh # Add /usr/local/share/npm/bin to PATH $ npm install coffee-script Monday, April 4, 2011
  • 36. Usage $ coffee -c path/to/script.coffee $ coffee --watch experimental.coffee $ coffee --print *.coffee > all.js Monday, April 4, 2011
  • 37. Significant Whitespace if happy and knowsIt clapsHands() chaChaCha() else showIt() Monday, April 4, 2011
  • 38. Significant Whitespace if (happy && knowsIt) { clapsHands(); chaChaCha(); } else { showIt(); } Monday, April 4, 2011
  • 39. Functions square = (x) -> x * x area = (x, y) -> x * y noop = -> Monday, April 4, 2011
  • 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. 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. 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. 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. 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. Pattern Matching theBait = 1000 theSwitch = 0 [theBait, theSwitch] = [theSwitch, theBait] weatherReport = (location) -> [location, 72, "Mostly Sunny"] [zip, temp, forecast] = weatherReport "20175 Monday, April 4, 2011
  • 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. 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+/g Monday, April 4, 2011
  • 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. 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. 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. Function Binding Account = (customer, cart) -> @customer = customer @cart = cart $('#checkout').bind 'click', (event) => @customer.purchase @cart Monday, April 4, 2011
  • 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. 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. Ideas for Getting Started Monday, April 4, 2011
  • 55. How We Use MongoDB at BusyConf Making great conferences even better busyconf.com Ryan McGeary Jim Garvin Monday, April 4, 2011
  • 58. Why NOT MongoDB? Monday, April 4, 2011
  • 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 S3 Monday, April 4, 2011
  • 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 M Monday, April 4, 2011
  • 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 n Monday, April 4, 2011
  • 62. Event Day 1 Day 2 Day n... Track 1 Track 2 Track n... TimeSlot 1 TimeSlot 2 TimeSlot n... Activity Speaker Monday, April 4, 2011
  • 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 @rmm5t Monday, April 4, 2011
  • 66. Cache Manifest <!DOCTYPE HTML> <html manifest="/mobile.manifest"> <body> ... </body> </html> text/cache-manifest Monday, April 4, 2011
  • 67. CACHE Sections CACHE MANIFEST http://www.google-analytics.com/ga.js /favicon.ico /javascripts/application.js /stylesheets/screen.css /data.json Monday, April 4, 2011
  • 68. NETWORK Sections CACHE MANIFEST NETWORK: * CACHE: http://www.google-analytics.com/ga.js /favicon.ico /javascripts/application.js /stylesheets/screen.css /data.json Monday, April 4, 2011
  • 69. FALLBACK Sections CACHE MANIFEST FALLBACK: / /offline.html NETWORK: * CACHE: http://www.google-analytics.com/ga.js /favicon.ico Monday, April 4, 2011
  • 70. Expiring The Cache CACHE MANIFEST # Updated: <%= something.updated_at %> # Released: <%= application_released_at %> NETWORK: * CACHE: # ... Monday, April 4, 2011
  • 71. window.applicationCache checking error updated NO manifest? noupdate YES downloading progress swapCache() NO already YES cached cached? updateready Monday, April 4, 2011
  • 72. Ryan McGeary ryan.mcgeary.org @rmm5t ryan@mcgeary.org McGeary Consulting Group Monday, April 4, 2011
  • 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