git checkout -b <branchname>
git add
git commit -m "description of changes"
| // namespace - single global variable for all news JS | |
| var news = news || {}; | |
| // Example of a singleton as a revealing module | |
| // When you only need one of something | |
| news.preferences = (function (app, global) { | |
| // Private variables | |
| var persistent = true; |
| // source: http://webreflection.blogspot.com/2011/11/few-javascript-patterns.html | |
| // duck typing ( maybe all you need ) | |
| var me = {name: "WebReflection"}; | |
| // basic class | |
| function Person() {} | |
| Person.prototype.getName = function () { | |
| return this.name; | |
| }; |
| /** | |
| * @memberOf __module | |
| * @type module | |
| */ | |
| var module = (/** @constructor */ function() { | |
| function privateMethod() { | |
| ... | |
| } |
| var inherit = (function () { | |
| var F = function () {}; | |
| return function (C, P) { | |
| F.prototype = P.prototype; | |
| C.prototype = new F(); | |
| C.uber = P.prototype; | |
| C.prototype.constructor = C; | |
| }; | |
| }()); |
| // | |
| // Backbone.Rails.js | |
| // | |
| // Makes Backbone.js play nicely with the default Rails setup, i.e., | |
| // no need to set | |
| // ActiveRecord::Base.include_root_in_json = false | |
| // and build all of your models directly from `params` rather than | |
| // `params[:model]`. | |
| // | |
| // Load this file after backbone.js and before your application JS. |
| /* Scaled-down Backbone.js demonstration | |
| * By Jacob Oscarson (http://twitter.com/jacob414), 2010 | |
| * MIT Licenced, see http://www.opensource.org/licenses/mit-license.php */ | |
| $(function() { | |
| window.ulog = function(msg) { $('#log').append($('<div>'+msg+'</div>')); } | |
| // Faking a little bit of Backbone.sync functionallity | |
| Backbone.sync = function(method, model, succeeded) { | |
| ulog('<strong>'+method + ":</strong> " + model.get('label')); | |
| if(typeof model.cid != 'undefined') { |
| module HashConverter | |
| class << self | |
| def to_underscore hash | |
| convert hash, :underscore | |
| end | |
| def to_camel_case hash | |
| convert hash, :camelize, :lower | |
| end | |
| def convert obj, *method | |
| case obj |
Create droplet of your liking (ubuntu 12.10 x32)
ssh to root in terminal with your server ip
ssh [email protected]
Add ssh fingerprint and enter password provided in email
with a hat tip to Sublime Text 2 Shortcuts
| ⌘; | autocomplete |
| ⌘⌥B | instant replay |
| ⌘⌥E | search across all tabs |