save_and_open_page
have_button(locator)| # Copyright 2010, Iain Hecker. All Rights Reserved | |
| # Conway's Game of Life, in one line of Ruby. | |
| # http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life | |
| # Tested and found working on Ruby 1.8.7 and 1.9.2 | |
| # The grid is spherical or "wrap around", so the left is connected to the right and top to bottom. | |
| # | |
| # Generate a random grid, 30 cells wide and 10 cells high | |
| # | |
| # grid = "30x10".to_grid | |
| # |
| ; A REPL-based, annotated Seesaw tutorial | |
| ; Please visit https://github.com/daveray/seesaw for more info | |
| ; | |
| ; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers | |
| ; Seesaw's basic features and philosophy, but only scratches the surface | |
| ; of what's available. It only assumes knowledge of Clojure. No Swing or | |
| ; Java experience is needed. | |
| ; | |
| ; This material was first presented in a talk at @CraftsmanGuild in | |
| ; Ann Arbor, MI. |
| class RecursiveOpenStruct < OpenStruct | |
| def new_ostruct_member(name) | |
| name = name.to_sym | |
| unless self.respond_to?(name) | |
| class << self; self; end.class_eval do | |
| define_method(name) { | |
| v = @table[name] | |
| case v | |
| when Hash | |
| RecursiveOpenStruct.new(v) |
| # 2. Include Sweeping module in your controller(s) to have cache_sweeper | |
| # method to be avaliable, or right in ApplicationController so it will be | |
| # available in all controllers inheriting from it. | |
| class ApplicationController < ActionController::Base | |
| include ActionController::Caching::Sweeping | |
| # ... | |
| end |
| require "rubygems" | |
| require "awesome_print" | |
| Pry.print = proc { |output, value| output.puts value.ai } |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| $stack, $draws = [], {} | |
| def method_missing *args | |
| return if args[0][/^to_/] | |
| $stack << args.map { |a| a or $stack.pop } | |
| $draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
| end | |
| class Array | |
| def +@ |
| require 'ostruct' | |
| module Awesome | |
| def self.config | |
| @config | |
| end | |
| def self.configure | |
| yield(config) | |
| end |
NOTE: THIS PATCH DOES NOT APPLY. Falcon's performance patches have not been updated for p362. See the comments for a fork that uses the Rails Express patch set instead.
This installs a patched ruby 1.9.3-p362 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.