- Strings
- Arrays
- Hashes
- Classes
- Conditionals (if)
- Conditional (case)
- Modules (for mixins)
- Namespaces
- requiring
- Gems
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
# https://github.com/sporkmonger/addressable/ | |
require 'addressable/template' | |
# http://dev.twitter.com/doc/get/statuses/followers | |
template = Addressable::Template.new 'http://{host=twitter.com}' + | |
'/statuses/followers{-prefix|/|id}.{format=json}' + | |
'?{-join|&|user_id,screen_name,cursor}' | |
template.expand(:id => 'mislav') | |
# => http://twitter.com/statuses/followers/mislav.json? |
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
# Include an anonymous module | |
# | |
# Useful for defining a class with a base module. So, instead of: | |
# | |
# class Foo | |
# module Base | |
# def bar | |
# # ... | |
# end | |
# end |
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
vagrant@lucid32:~$ sudo su postgres | |
postgres@lucid32:/home/vagrant$ psql | |
psql (8.4.8) | |
Type "help" for help. | |
postgres=# SELECT * FROM pg_user; | |
usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil | useconfig | |
----------+----------+-------------+----------+-----------+----------+----------+----------- | |
postgres | 10 | t | t | t | ******** | | | |
rails | 16385 | t | t | t | ******** | | |
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
node_modules |
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
require 'rbczmq' | |
require 'fileutils' | |
require 'celluloid' | |
class Heartbeat | |
include Celluloid | |
def self.start(id = nil, options = nil) | |
new(ZMQ::Context.new, id, options) | |
end |
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
function cleardb { | |
DEVDB="`ruby -e "require 'yaml'; puts YAML.load(File.open('config/database.yml'))['development']['database']"`" | |
if [[ $DEVDB =~ "production" ]]; then | |
echo 'WATCHOUT! cleardb running against production dump'; | |
else | |
bundle exec rake db:drop db:create db:schema:load db:seed && bundle exec rake db:test:clone; | |
fi | |
} |
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
# Save this in an empty directory as Vagrantfile and run: | |
# | |
# gem install vagrant | |
# vagrant up | |
# vagrant ssh | |
# | |
# You need to have a recent VirtualBox installed. | |
Vagrant::Config.run do |config| | |
config.vm.box = "travis-ruby" | |
config.vm.box_url = "http://files.travis-ci.org/boxes/provisioned/travis-ruby.box" |
How to get to the Travis CI office: http://goo.gl/maps/vmidH
The address is Prinzessinnenstrasse 20, on the left driveway:
Conference | Date | Location | Contact | Reply | |
---|---|---|---|---|---|
Distill | @distill | 08-09.08. | USA, San Francisco | distill@engineyard.com | 2 free tickets + hotel |
JRubyConf EU | @JRubyConfEU | 14-15.08. | Germany, Berlin | info@eurucamp.org | 2 free tickets |
eurucamp | @eurucamp | 16-18.08. | Germany, Berlin | info@eurucamp.org |
OlderNewer