- Pas
- Rejsepapirer
- Handsker
- Skiundertøj
- Skipulli
$a = {} | |
3.times do | |
$a.fetch(:key) { puts "Fetch :key" ; :b } | |
end |
class Result | |
def success(&blk) | |
@success = blk | |
end | |
def succeeded | |
@success.call | |
end | |
def failure(&blk) |
Routing with etcd | |
----------------- | |
A site has the following structure: | |
/name | |
/current_revision => [revision] | |
/nodes | |
/[revision] | |
/[nodename] => [url] |
jacob@sales01:~/timebuild$ cat Dockerfile | |
FROM ubuntu | |
ADD . /foo | |
jacob@sales01:~/timebuild$ sudo docker build -t commitbuild . | |
Uploading context 10.24 kB | |
Uploading context | |
Step 1 : FROM ubuntu | |
---> 8dbd9e392a96 | |
Step 2 : ADD . /foo | |
---> d4e96c9ed83a |
# From http://my.rails-royce.org/2010/07/21/email-validation-in-ruby-on-rails-without-regexp/ | |
require 'mail' | |
class EmailAddressValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
begin | |
m = Mail::Address.new(value) | |
# We must check that value contains a domain and that value is an email address | |
r = m.domain && m.address == value | |
t = m.__send__(:tree) |
forum_table = Forum.arel_table | |
User.where(:id => forum_table.project('user_id').where(forum_table['id'].eq(3))) |
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin13.0] | |
>> machine_bytes = ['foo'].pack('p').size | |
=> 8 | |
>> machine_bits = machine_bytes * 8 | |
=> 64 | |
>> machine_max_signed = 2**(machine_bits-1) - 1 | |
=> -9223372036854775809 | |
>> machine_max_unsigned = 2**machine_bits - 1 | |
=> -1 |
module I18n | |
module Backend | |
class Error | |
include Base | |
def lookup(locale, key, scope = [], options = {}) | |
case key | |
when /missing/ | |
nil | |
when /count/ |
Fetching from: http://rubygems.org/api/v1/dependencies | |
HTTP Redirection | |
Fetching from: http://bundler.rubygems.org/api/v1/dependencies | |
HTTP Success | |
Fetching source index from http://rubygems.org/ | |
Fetching from: http://rubygems.org/quick/Marshal.4.8/piet-0.1.0.gemspec.rz | |
HTTP Redirection | |
Fetching from: http://bb-m.rubygems.org/quick/Marshal.4.8/piet-0.1.0.gemspec.rz | |
HTTP Success | |
Fetching from: http://rubygems.org/quick/Marshal.4.8/rake-10.1.0.gemspec.rz |