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
| fs.unlink("/tmp/app.sock", function(err) { | |
| app.listen("/tmp/app.sock"); | |
| return setTimeout(function() { | |
| return fs.chmod("/tmp/app.sock", 0x777, function(callback) {}); | |
| }, 2000); | |
| }); |
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
| # install os | |
| # setup ssh keys | |
| # add build tools | |
| sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev | |
| # NginX | |
| sudo add-apt-repository ppa:nginx/stable |
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.config({ | |
| baseUrl: '/backbone-tests/', | |
| paths: { | |
| 'jquery' : '/app/libs/jquery', | |
| 'underscore' : '/app/libs/underscore', | |
| 'backbone' : '/app/libs/backbone', | |
| 'mocha' : 'libs/mocha', | |
| 'chai' : 'libs/chai', | |
| 'chai-jquery' : 'libs/chai-jquery', | |
| 'models' : '/app/models' |
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
| http://backbonejs.org/ | |
| http://marionettejs.com/ | |
| https://github.com/documentcloud/backbone/wiki/Tutorials,-blog-posts-and-example-sites | |
| http://backbonefu.com/2011/11/modifying-your-urls-on-the-fly-using-the-request-method-with-sync-in-backbone-js/ | |
| http://addyosmani.github.com/backbone-fundamentals/#marionette | |
| http://addyosmani.github.com/backbone-fundamentals/#memory-management | |
| https://github.com/jsoverson/todomvc/tree/master/labs/architecture-examples/backbone_marionette | |
| http://davidsulc.com/blog/2012/04/15/a-simple-backbone-marionette-tutorial/ | |
| http://davidsulc.com/blog/2012/04/22/a-simple-backbone-marionette-tutorial-part-2/ | |
| http://davidsulc.github.com/backbone.marionette-collection-example/ |
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
| Why | |
| --- | |
| My site is backbone.js and rails, including the static marketing content. I wanted this content to be readable by google and I don't want two copies. | |
| Background | |
| ---------- | |
| I'm using the haml_assets gem so I can write backbone.js views in haml. | |
| Routes | |
| ------ |
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
| location /system { | |
| rewrite /system/ http://cr.s3.amazonaws.com/system/$1 permanent; | |
| } |
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
| TEMPLATE | |
| ---- | |
| %form#uploadAsset{"accept-charset" => "UTF-8", :action => "/admin/assets", "data-remote" => "true", :enctype => "multipart/form-data", :method => "post"} | |
| %div{:style => "margin:0;padding:0;display:inline"} | |
| %input{:name => "utf8", :type => "hidden", :value => "✓"}/ | |
| %input{:name => "authenticity_token", :type => "hidden", :value => ""}/ | |
| .element | |
| .avatar.thin | |
| %label.hint#assetLabel | |
| Your Asset |
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
| do -> | |
| _parse = Backbone.Model.prototype.parse | |
| _.extend Backbone.Model.prototype, | |
| initNestedCollections: (nestedCollections) -> | |
| @_nestedCollections = {} | |
| _.each nestedCollections, (theClass, key) => | |
| @_nestedCollections[key] = new theClass([]) | |
| @resetNestedCollections() |
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
| #$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path. | |
| require 'bundler/capistrano' | |
| require 'rvm/capistrano' | |
| require "capistrano_colors" | |
| require 'thinking_sphinx/deploy/capistrano' | |
| require 'delayed/recipes' | |
| set :normalize_asset_timestamps, false | |
| set :rvm_type, :user | |
| set :rvm_ruby_string, 'ruby-1.9.3-p125@appname' |
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
| gem install bundler --pre | |
| create a "appname-staging" bucket on S3 | |
| create a "appname-production" bucket on S3 | |
| rails new appname -d postgresql | |
| rvm ruby-1.9.3-p194-perf@appname --create | |
| add ruby "1.9.3" to Gemfile (2nd line) |