An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
| // overriding sync to use local storage when possible | |
| sync : function(method, model, options){ | |
| var key, now, timestamp, refresh; | |
| if(method === 'read' && this.constants.isStoredInLocalStorage) { | |
| // only override sync if it is a fetch('read') request | |
| key = this.getKey(); | |
| if(key) { | |
| now = new Date().getTime(); | |
| timestamp = $storage.get(key + ":timestamp"); | |
| refresh = options.forceRefresh; |
| check_browser: (navigator) -> | |
| N = navigator.appName | |
| ua = navigator.userAgent | |
| tem = undefined | |
| M = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i) | |
| M[2] = tem[1] if M and (tem = ua.match(/version\/([\.\d]+)/i))? | |
| M = (if M then [M[1], M[2]] else [N, navigator.appVersion, "-?"]) | |
| M |
| class User | |
| include Mongoid::Document | |
| include Mongoid::Timestamps | |
| devise :database_authenticatable, :registerable, | |
| :recoverable, :rememberable, :trackable, :validatable | |
| has_one :profile, :class_name => 'Profile', :foreign_key => :person_id |
| Failures: | |
| 1) MicropostsController POST 'create' failure should render the home page | |
| Failure/Error: response.should render_template('pages/home') | |
| expecting <"pages/home"> but rendering with <""> | |
| # ./spec/controllers/microposts_controller_spec.rb:38:in `block (4 levels) in <top (required)>' | |
| 2) MicropostsController POST 'create' success should create a micropost | |
| Failure/Error: lambda do | |
| count should have been changed by 1, but was changed by 0 |