This file contains hidden or 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
| #!/usr/bin/env node | |
| var app = require('../watch'); | |
| var static_dir = '.'; | |
| if (process.argv.length > 2) { | |
| static_dir = process.argv[2]; | |
| } | |
| app.init(static_dir); |
This file contains hidden or 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
| > npm install . -g | |
| #check to see if everything is working | |
| > watchjs | |
| Starting server on... #great |
This file contains hidden or 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
| $BV.configure("global", { | |
| ... old stuff ..., | |
| onEvent: function(json) { | |
| if (json.bvProduct === "Stories" && eType === "Read") { | |
| //your resize function for SY | |
| } else if (json.bvProduct === "RatingsAndReview" && eType === "Read") { | |
| // your resize function for RR | |
| } | |
| } |
This file contains hidden or 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
| require 'rubygems' | |
| require 'sinatra' | |
| require 'json' | |
| mime_type :manifest, 'text/cache-manifest' | |
| get '/*.*' do | |
| #content_type :manifest | |
| send_file('./' + params[:splat].join('.')) | |
| end |
This file contains hidden or 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
| /* | |
| Javascript is an incredibly fun and (relatively) easy language. It's also | |
| really easy to do badly... in some ways js is out to get you, so if you're | |
| ready for it, you can avoid the pitfalls and have a great time. | |
| Ideally this talk gets you thinking of Javascript as the unique, | |
| quasi-dangerous little beast that is. If you respect the ways in which it | |
| is your enemy, it will become one of your best friends. | |
| This presentation isn't intended to teach javascript (though you'll probably |
This file contains hidden or 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
| /* Director's routes config | |
| routes that have segments that start with colons, | |
| like /lists/:listType, will pass in the variable to | |
| the callback. | |
| */ | |
| var routes = { | |
| '/app': function() { | |
| ; |
This file contains hidden or 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
| App.stateManager = Ember.StateManager.create({ | |
| //Swap state within this element | |
| rootElement: "#appRoot", | |
| //Simple State | |
| overview: Ember.ViewState.create({ | |
| view: App.Overview | |
| }), |
This file contains hidden or 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
| /* | |
| Equality operators: ===, !== vs. ==, != | |
| The second set are the 'evil twins'. They attempt to coerce values, | |
| but do a real crap job of it. | |
| Evidence: | |
| */ | |
| '' == 0 // true |
This file contains hidden or 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
| // $.fn.live misuse | |
| (function() { | |
| // cache all elements that match this selector *as they exist on the page right now* | |
| // let's say this is empty at this point in time | |
| var $posts = $(".posts"); | |
| // set up a click listener. this is totally valid with $.fn.live, | |
| // any new ".posts" that get added to the DOM will automatically respond to this |
This file contains hidden or 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
| modules: [{ | |
| name: "foo/bar/bop", | |
| override: { | |
| pragmas: { | |
| out: "bop-build.js" | |
| } | |
| } | |
| }, { | |
| name: "other", | |
| override: { |