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
$ zeus start | |
Starting Zeus server | |
[ready] [crashed] [running] [connecting] [waiting] | |
boot | |
└── default_bundle | |
├── development_environment | |
│ └── prerake | |
└── test_environment |
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
class ExampleController < ApplicationController | |
def some_post_action | |
@some_model = SomeModel.some_factory_method(params). | |
validate(:make_one_particular_and_unique_thingy_go_red_and_stop_save) | |
... | |
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
$ grep -re test -e should Gemfile.lock | |
remote: git://github.com/bbozo/minitest-colorize.git | |
minitest-colorize (0.0.4.1) | |
minitest (>= 2.0) | |
rack-test (~> 0.6.1) | |
rack-test (>= 0.5.4) | |
minitest (4.5.0) | |
minitest-matchers (1.2.0) | |
minitest (>= 2.5.0) | |
minitest-rails (0.5.1) |
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
class UserController < ApplicationController | |
def create | |
@user = SomeUserForm.new(params[:user]) do |f| | |
f.user = User.new | |
f.email = Email.new | |
end | |
return unless post? | |
if @user.save |
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
All A outputs: | |
AA | |
A | |
AAAAAAAAAA | |
AAA | |
AAAA | |
AAAAA | |
AAAAAA | |
AAAAAAA | |
AAAAAAAA |
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 'csv' | |
# address = '245.245.245.245' | |
address = '24.24.24.24' | |
def ip_address_to_int address | |
( o1, o2, o3, o4 ) = address.split('.').map(&:to_i) | |
16777216 * o1 + 65536 * o2 + 256 * o3 + o4 |
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
GEM | |
remote: https://rubygems.org/ | |
specs: | |
actionmailer (3.2.14) | |
actionpack (= 3.2.14) | |
mail (~> 2.5.4) | |
actionpack (3.2.14) | |
activemodel (= 3.2.14) | |
activesupport (= 3.2.14) | |
builder (~> 3.0.0) |
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
GIT | |
remote: https://github.com/airblade/paper_trail.git | |
revision: c441a5de2d61042126bb042c3c18012fca3af32b | |
branch: rails4 | |
specs: | |
paper_trail (2.7.2) | |
activerecord (~> 4.0) | |
railties (~> 4.0) | |
GIT |
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 'eventmachine' | |
Thread.new{ EM.run } | |
until EM.reactor_running?; sleep 0.1; end | |
EM.add_periodic_timer(1){ puts "tick" } | |
sleep 5 |
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
bbozo@vilma:~/dev/0000_dallywagging/rabbitmq$ rvm use ruby | |
Using /home/bbozo/.rvm/gems/ruby-2.0.0-p247 | |
bbozo@vilma:~/dev/0000_dallywagging/rabbitmq$ ruby amqp_hello.rb | |
Connecting to RabbitMQ. Running 1.1.1 version of the gem... | |
amqpgem.examples.hello_world | |
================================================================================ | |
foo | |
roko | |
Received a message: Hello, world!. Disconnecting... | |
tick |
OlderNewer