View observable_example.rb
# We only care about Tick and Alarm events.
# The Alarm event should only be handled once.
# All other events should be ignored.
require 'observer'
class Clock
include Observable
def tick
View ruby_arduio_meetup.markdown



What is Arduino?

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.

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]
View ninja.rb
class Ninja
def initialize(name, &block)
@name = name
@move = block
def attack
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="//" type="text/javascript"></script>
<!--[if !IE]>-->
<script src="/assets/zepto.min.js?body=1" type="text/javascript"></script>
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) {
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')
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'
View gist:1453272
def reorder
redirect_to confirm_order_path and return if params[:reorder] ==
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