- An
Object
is a set of instance variables and a pointer to a 'singleton class'. - Properties are looked up in the instance variables, methods are dispatched via the singleton class.
Module
is a subtype ofObject
. AModule
is a set of methods and an ordered list of zero-or-more 'parent' modules.- Module
A
becomes a parent of moduleB
viaB.include(A)
. - Method lookup works by doing a depth-first right-to-left search of a module tree.
Class
is a subtype ofModule
. AClass
is aModule
that can be instantiated.- A
Class
has only one 'superclass'. A class includes its superclass as its first parent module for the purposes of method dispatch. A class's singleton class includes the superclass's singleton class as its first parent. - The default superclass of all classes is
Object
.
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
1981:cms $ rspec ./spec/models/sqs_queue_processor_spec.rb -fs --color | |
/Users/xxx.yyy/.rvm/gems/ruby-1.9.3-p286@mew_cms/gems/padrino-core-0.10.6/lib/padrino-core/reloader.rb:106:in `block in lock!': undefined method `split' for name(.):XPath::Expression::Name (NoMethodError) | |
from /Users/xxx.yyy/.rvm/gems/ruby-1.9.3-p286@mew_cms/gems/padrino-core-0.10.6/lib/padrino-core/reloader.rb:106:in `map' | |
from /Users/xxx.yyy/.rvm/gems/ruby-1.9.3-p286@mew_cms/gems/padrino-core-0.10.6/lib/padrino-core/reloader.rb:106:in `lock!' | |
from /Users/xxx.yyy/.rvm/gems/ruby-1.9.3-p286@mew_cms/gems/padrino-core-0.10.6/lib/padrino-core/loader.rb:68:in `load!' | |
from /Users/xxx.yyy/Documents/work/cms/config/boot.rb:66:in `<top (required)>' | |
from /Users/xxx.yyy/Documents/work/cms/spec/spec_helper.rb:2:in `require' | |
from /Users/xxx.yyy/Documents/work/cms/spec/spec_helper.rb:2:in `<top (required)>' | |
from /Users/xxx.yyy/Documents/work/cms/spec/models/sqs_queue_processor_spec.rb:1:in `requir |
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
# Defines our constantsPADRINO_ENV = ENV['PADRINO_ENV'] ||= ENV['RACK_ENV'] ||= 'development' unless defined?(PADRINO_ENV) | |
PADRINO_ROOT = File.expand_path('../..', __FILE__) unless defined?(PADRINO_ROOT) | |
# Load our dependencies | |
require 'rubygems' unless defined?(Gem) | |
require 'bundler/setup' | |
Bundler.require(:default, PADRINO_ENV) | |
require_relative '../lib/database' | |
## |
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
%s/:\(\w\+\)\(\s*=>\s*\)/\1: /gc |
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
#/etc/udev/rules.d/98-usb.rules | |
KERNEL=="sd*", SUBSYSTEM=="block", ENV{ID_SERIAL_SHORT}=="FDC0FD20EF00000FD0FFC4F0715317", SYMLINK+="usb" |
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
#privoxy running HTTP proxy on port 8118 | |
iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --uid-owner debian-transmission -j REDIRECT --to-port 8118 |
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
ssh-copy-id [email protected] | |
# on the pi | |
sudo su - | |
cat <<EOF >> /etc/wpa_supplicant/wpa_supplicant.conf | |
network={ | |
ssid="Your SSID Here" | |
proto=RSN | |
key_mgmt=WPA-PSK | |
pairwise=CCMP |
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
scanimage --resolution 300 --mode Gray --button-controlled=yes \ | |
--format=tiff --batch-count 3 --batch="/nas/incoming/image-%d.tiff" |
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
keys *name* | |
type name (should be SET) | |
smembers name |
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
avrdude -c gpio -p m328p -U flash:w:file_name.hex |
OlderNewer