This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I would like to combine 1f9c2db and 890164b so there is only one merge. | |
* 1f9c2db - (HEAD, integration) Merge branch 'topic' into integration (4 minutes ago) <Aaron Jensen> | |
|\ | |
| * 890164b - (integration) Merge branch 'topic' into integration (4 minutes ago) <Aaron Jensen> | |
| |\ | |
| | * 9f8452b - (topic) topic (4 minutes ago) <Aaron Jensen> | |
| |/ | |
* | 2d51b1b - Merge branch 'topic2' into integration (5 minutes ago) <Aaron Jensen> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless Rails.env.test? | |
Rack::MiniProfiler.config.position = 'right' | |
Rack::MiniProfiler.config.pre_authorize_cb = lambda {|env| true } | |
Rack::MiniProfiler.config.authorization_mode = :whitelist unless Rails.env.development? | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* What is tmux? | |
* Why tmux? | |
* tmux vs screen: http://www.wikivs.com/wiki/Screen_vs_tmux | |
* Install tmux | |
* brew install tmux | |
* tmux basics | |
* leader key (default sucks) | |
* sessions | |
* windows | |
* panes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[18:12:58 app (feature/403 $ u=)]$ time __git_ps1 | |
(feature/403 $ u=) | |
real 0m0.072s | |
user 0m0.037s | |
sys 0m0.033s | |
[18:13:18 app (feature/403 $ u=)]$ which hub | |
hub is /usr/local/bin/hub | |
[18:13:32 app (feature/403 $ u=)]$ which git | |
git is /usr/local/bin/git | |
git is /usr/bin/git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Place in config/initializers | |
ActiveRecord::Base.class_eval do | |
class << self | |
def inherited_with_strong_params(sub) | |
inherited_without_strong_params(sub) | |
# Filter out plugin models that won't work with strong_parameters yet | |
unless sub.name =~ /^doorkeeper/i | |
sub.send :include, ActiveModel::ForbiddenAttributesProtection | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# place in spec/support/prevent_database_access.rb | |
ActiveRecord::ConnectionAdapters::Mysql2Adapter.class_eval do | |
def execute_with_prevent_database_access(sql, name=nil) | |
if prevent_database_access?(sql) | |
raise "You should only access the database in model and acceptance specs. | |
If you really need to you can use :db to grant access for that spec. | |
Offending query: \"#{sql}\"" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
Dir.chdir File.join(__FILE__, "../..") | |
unless ENV['EDITOR'] | |
puts "No EDITOR found. Try:" | |
puts "export EDITOR=vim" | |
exit 1 | |
end | |
unless ARGV.count == 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define a new role "super class" | |
Applicant = Role.new do | |
def apply | |
# ... | |
end | |
end | |
# Applicant[User] returns a cacheable class that inherits from User but | |
# has the behavior of the Applicant role as well | |
# i.e. calling Applicant[User] is equivalent to writing this: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_very_rails | |
project = Project.create project_params | |
if project.persisted? | |
sync_new project | |
redirect_to project | |
else | |
redirect_to edit_project_path(project) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module EnableModelSync | |
extend ActiveSupport::Concern | |
included do | |
around_filter :enable_sync | |
end | |
def enable_sync | |
ModelSync.enable(self) do | |
yield |