I hereby claim:
- I am synth on github.
- I am synth (https://keybase.io/synth) on keybase.
- I have a public key whose fingerprint is 21F3 1810 5912 3776 C65E B287 C33D 7669 E2A2 3723
To claim this, I am signing this object:
#/spec/support/asynchronous_helper.rb | |
module AsynchronousHelper | |
def wait_until_remote_events_are_bound | |
page.wait_until do | |
page.evaluate_script("typeof($assetsloaded) === 'object'") | |
end | |
end | |
def wait_until_overlay_has_popped_up |
$> rails new mynewapp | |
$> cd mynewapp | |
$> rails g model User | |
$> rails g model Whatever | |
$> rake db:migration | |
#user.rb | |
belongs_to :whatever | |
$> rails c |
# | |
# = Capistrano Assets recipe | |
# | |
# Provides a couple of tasks for precompiling assets locally | |
# Assumes usage of AssetSync to deploy to CloudProvider or CDN | |
# | |
# Inspired by http://www.rostamizadeh.net/blog/2012/04/14/precompiling-assets-locally-for-capistrano-deployment | |
namespace :deploy do |
# NOTE: this architecture hinges on the channels being specific to the user | |
# this allows us to know what permissions context to render templates under | |
# seeing as how this may need to be run in a background task without a "current user" context | |
# so the "current user" is really the recipient of the notification | |
class ApplicationPusher < ActionPusher::Base | |
attr_accessor :channel, :event, :current_user | |
include ActionController::HideActions | |
include Authorization::AuthorizationInController |
def nice_errors(object, errors) | |
object.errors.each do |key| | |
error_obj = object.send(key) | |
if error_obj.kind_of?(Array) | |
errors[key] = {} | |
error_obj.each {|item| nice_errors(item, errors[key])} | |
elsif error_obj.kind_of?(ActiveRecord::Base) | |
errors[error_obj.id] = {} | |
nice_errors(error_obj, errors[error_obj.id]) | |
else |
Shiva:recognize pete$ direnv status | |
direnv exec path /usr/local/Cellar/direnv/2.3.0/bin/direnv | |
DIRENV_CONFIG /Users/pete/.config/direnv | |
No .envrc loaded | |
Found RC path /Users/pete/work/recognize/.envrc | |
Found RC mtime 1399402756 | |
Found RC allowed true | |
Found RC allowPath /Users/pete/.config/direnv/allow/ff6c702ed5d2ddd9c0c25dc39583506d3fe5944604480c51eb7473287e7d7d48 |
rails g model Post | |
rails g model Comment post_id:integer comment:string | |
rails c | |
p1 = Post.create | |
p2 = Post.create | |
p1.comments.create(comment: "1") | |
p1.comments.create(comment: "2") | |
p2.comments.create(comment: "3") | |
p2.comments.create(comment: "4") |
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'arel', github: 'rails/arel' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
end |
I hereby claim:
To claim this, I am signing this object:
module Foo | |
def print_hello | |
puts HELLO | |
end | |
end | |
class Bar | |
HELLO="hi there!" | |
include Foo | |
end |