Skip to content

Instantly share code, notes, and snippets.

View pigoz's full-sized avatar
:copilot:
Being replaced by AI

Stefano Pigozzi pigoz

:copilot:
Being replaced by AI
View GitHub Profile

Routing in Ember

In Ember, the application's state manager handles routing. Let's take a look at a simple example:

App.stateManager = Ember.StateManager.create({
  start: Ember.State.extend({
    index: Ember.State.extend({
      route: "/",
-> % vagrant status
/home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/driver/virtualbox.rb:26:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/vm.rb:136:in `new'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/vm.rb:136:in `rescue in reload!'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/vm.rb:128:in `reload!'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/vm.rb:35:in `initialize'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/environment.rb:430:in `new'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/environment.rb:430:in `block in load_vms!'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/environme
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@jicksta
jicksta / gist:1001736
Created June 1, 2011 03:19
Jasmine shared behavior for asserting that a certain event on an element exposed as a Backbone view property properly executes the expected view instance method
function assertViewAction(viewClass, eventCallbackName, elementAccessorName, eventName, viewReference) {
it("should run the " + eventCallbackName + " action when the " + elementAccessorName + " gets a " + eventName + " event (assertViewAction)", function() {
var isPrototypal = eventCallbackName in viewClass.prototype;
if (isPrototypal) {
spyOn(viewClass.prototype, eventCallbackName);
}
var view = viewReference();
if (!isPrototypal) {
spyOn(view, eventCallbackName);
}
@tenderlove
tenderlove / person_test.rb
Created February 10, 2011 23:04
Use minitest/spec with Rails 3
require 'test_helper'
require 'minitest/autorun'
module Tenderlove
class Spec < MiniTest::Spec
include ActiveSupport::Testing::SetupAndTeardown
include ActiveRecord::TestFixtures
alias :method_name :__name__ if defined? :__name__
self.fixture_path = File.join(Rails.root, 'test', 'fixtures')
This example shows how to setup an environment running Rails 3 under 1.9.2 with a 'rails3' gem set.
∴ rvm update --head
# ((Open a new shell)) or do 'rvm reload'
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.2
# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist.
∴ rvm --create use 1.9.2@rails3