a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| // this allows culerity to wait until all ajax requests have finished | |
| jQuery(function($) { | |
| var original_ajax = $.ajax; | |
| var count_down = function(callback) { | |
| return function() { | |
| try { | |
| if(callback) { | |
| callback.apply(this, arguments); | |
| }; | |
| } catch(e) { |
| We have discovered the cause of [bug], and it is both simple and surprising. | |
| Upon investigation, we were stunned to find that the [function] is totally wrong. |
| # Include an anonymous module | |
| # | |
| # Useful for defining a class with a base module. So, instead of: | |
| # | |
| # class Foo | |
| # module Base | |
| # def bar | |
| # # ... | |
| # end | |
| # end |
| describe "routes to the articles controller" do | |
| extend RouteSpecHelpers | |
| scope_options controller: 'articles', blog: 'my_blog' | |
| get '/blogs/my_blog/articles/new' => { action: 'new' } | |
| post '/blogs/my_blog/articles' => { action: 'create' } | |
| get '/blogs/my_blog/articles/1' => {action: 'show', id: '1' } | |
| var _flash_installed = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) != false)); |
| /** | |
| * Provides requestAnimationFrame in a cross browser way. | |
| * @author paulirish / http://paulirish.com/ | |
| */ | |
| if ( !window.requestAnimationFrame ) { | |
| window.requestAnimationFrame = ( function() { | |
| return window.webkitRequestAnimationFrame || |
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| require 'sinatra/base' | |
| class MyApp < Sinatra::Base | |
| @@my_app = {} | |
| def self.new(*) self < MyApp ? super : Rack::URLMap.new(@@my_app) end | |
| def self.map(url) @@my_app[url] = self end | |
| class FooController < MyApp | |
| map '/foo' |