Mike Breen hardbap

View gist:8320251
1 2 3 4 5 6 7 8 9 10
export LANGUAGE="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
 
sudo su postgres
 
psql
 
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
View migration.rb
1 2 3 4 5 6 7
jruby 1.7.4
rails (4.0.0)
jdbc-postgres (9.2.1002.1)
activerecord-jdbc-adapter (1.2.9.1)
activerecord-jdbcpostgresql-adapter (1.2.9)
 
undefined method `enable_extension' for #<CreatePosts:0x30186092>org/jruby/RubyBasicObject.java:1696
View routes.rb
1 2 3
resources :sellers, only: [ :index, :show ] do
resources :contracts, shallow: true
end
View gist:5084073
1 2 3 4 5 6 7 8 9 10
Using rake (10.0.3)
Installing i18n (0.6.4)
Installing minitest (4.6.2)
Installing multi_json (1.6.1)
Installing atomic (1.0.1)
Installing thread_safe (0.1.0)
Installing tzinfo (0.3.36)
Installing activesupport (4.0.0.beta1)
Installing builder (3.1.4)
Installing erubis (2.7.0)
View chat.rb
1 2 3 4 5 6 7 8 9 10
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
 
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
 
get '/stream', provides: 'text/event-stream' do
View readme.md

Wall·E

Ruby powered robots.

Prerequisites

  1. Download and install the Arduio IDE for your OS
  2. Download and unzip Firmata 2.2
  3. Plug in your Arduino via USB
  4. Open the Arduino IDE, select: File > Open > [Path from step 2] > examples > StandardFirmata
View observable_example.rb
1 2 3 4 5 6 7 8 9 10
# 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

Prereq

Arduino

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
1 2 3 4 5 6 7
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
1 2 3 4 5 6 7 8 9 10
class Ninja
def initialize(name, &block)
@name = name
@move = block
end
 
def attack
@move.call
end
end
Something went wrong with that request. Please try again.