Skip to content
View routes.rb
MyApp::Application.routes.draw do
# we only need index and show
resources :posts, :only => [:index, :show]
# we need everything but destroy
resources :widgets, :except => [:destroy]
end
View ninja.rb
class Ninja
def initialize(name, &block)
@name = name
@move = block
end
def attack
@move.call
end
end
View gist:2851226
/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
<!--[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
// 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
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
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
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
query = MyModel.where("id = :id", :id => 21)
query = query.merge(MyModel.some_scope)
MyModel.connection.select_all(query.to_sql)
Something went wrong with that request. Please try again.