Mike Breen hardbap

View gist:2851226
1 2 3 4 5 6 7
/Users/hardbap/.rvm/gems/ruby-1.9.2-p290@thumb/gems/activesupport-3.2.5/lib/active_support/core_ext/class/attribute.rb:75:in `accessible_attributes': wrong number of arguments (1 for 0) (ArgumentError)
from /Users/hardbap/.rvm/gems/ruby-1.9.2-p290@thumb/gems/actionpack-3.2.5/lib/action_controller/metal/params_wrapper.rb:171:in `_set_wrapper_defaults'
from /Users/hardbap/.rvm/gems/ruby-1.9.2-p290@thumb/gems/actionpack-3.2.5/lib/action_controller/metal/params_wrapper.rb:133:in `inherited'
from /Users/hardbap/.rvm/gems/ruby-1.9.2-p290@thumb/gems/actionpack-3.2.5/lib/abstract_controller/railties/routes_helpers.rb:7:in `block (2 levels) in with'
from /Users/hardbap/.rvm/gems/ruby-1.9.2-p290@thumb/gems/actionpack-3.2.5/lib/action_controller/railties/paths.rb:7:in `block (2 levels) in with'
from /Users/hardbap/code/opinionaided/thumb/app/controllers/pages_controller.rb:1:in `<top (required)>'
from /Users/hardbap/.rvm/gems/ruby-1.9.2-p290@thumb/gems/activesupport-3.2.5/
View gist:2276174
1 2 3 4 5 6
<!--[if IE]>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<![endif]-->
<!--[if !IE]>-->
<script src="/assets/zepto.min.js?body=1" type="text/javascript"></script>
<!--<![endif]-->
View _media-queries.scss
1 2 3 4 5 6 7 8 9 10
// Dimensions of devices
// iPad Retina - 1536x2048
// iPad - 768x1024
// iPhone - 320x480
// iPhone Retina - 640x960
 
@mixin mobile-only {
@media only screen and (max-width : 480px) {
@content;
}
View tweet.rake
1 2 3 4 5 6 7
namespace :tweets do
desc 'Send some tweets to a user'
task :send, [:username] => [:environment] do |t, args|
args.with_defaults(:username => 'cpytel')
Tweet.send(args[:username])
end
end
View Gemfile
1 2 3 4 5 6 7
group :guard do
gem 'guard', '= 0.8.8' # works with my (old) version of growl
gem 'rb-fsevent', :require => false
gem 'growl_notify', :require => false
gem 'guard-coffeescript'
gem 'guard-sass'
end
View gist:1453272
1 2 3 4 5 6 7 8 9 10
def reorder
redirect_to confirm_order_path and return if params[:reorder] == current_order.id.to_s
 
reorder = current_user.orders.find(params[:reorder])
 
redirect_to favorites_order_path, :notice => 'The order is no longer available.' and return if reorder.nil?
 
redirect_to favorites_order_path, :notice => 'There are items in your cart. Please cancel your current order before reordering.' and return if (current_order.items.any?)
 
search_result = reorder.next_available_delivery
View TechDecisions.md

Team Support

Source Code Control

git (private server)
Alternative: github

Time Tracking

Cashboard

View gist:1385894
1 2 3 4
query = MyModel.where("id = :id", :id => 21)
query = query.merge(MyModel.some_scope)
 
MyModel.connection.select_all(query.to_sql)
View gist:1374101
1 2 3 4 5 6 7 8 9 10
new_order = reorder.xerox
new_order.save
current_order.destroy
current_order = new_order
current_order.status = 'open'
current_order.favorite = false
current_order.created_at = DateTime.now
current_order.updated_at = DateTime.now
current_order.mealsoft_response = nil
current_order.error_message = nil
View development.rb
1 2 3 4 5 6 7 8 9 10
# From Dan Watsons Coding Zen
# http://www.dotnetguy.co.uk/post/2011/08/23/replace-the-rails-console-with-pry
 
MyApp::Application.configure do
silence_warnings do
begin
require 'pry'
IRB = Pry
rescue LoadError
end
Something went wrong with that request. Please try again.