Table of Contents:
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
#!/usr/bin/env bash | |
brew install docker boot2docker | |
boot2docker init | |
boot2docker up | |
export DOCKER_HOST="tcp://localhost:4243" |
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 'active_support/core_ext/time' | |
class BusinessHoursFeature | |
# This feature is only available between the hours of 10am and 4pm | |
def enabled? | |
Time.use_zone('Pacific Time (US & Canada)') do | |
now = Time.zone.now | |
am, pm = Time.zone.parse('10:00'), Time.zone.parse('16:00') | |
weekday = !(now.saturday? || now.sunday?) |
I hereby claim:
- I am davidcelis on github.
- I am davidcelis (https://keybase.io/davidcelis) on keybase.
- I have a public key whose fingerprint is 7932 F3A5 43C4 7961 B2FF E77A 4A35 06D4 2B00 16D7
To claim this, I am signing this 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
puts "Hello, world." |
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 HelloWorld { | |
public static void main(String[] args) { | |
System.out.println("Hello from Java"); | |
} | |
} |
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 'docker' | |
container = Docker::Container.create( | |
'Image' => 'ubuntu:14.04', | |
'Cmd' => [ | |
'/bin/bash', | |
'-c', | |
'for i in {1..10}; do echo $i; sleep 1; done' | |
] | |
) |
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 User < ActiveRecord::Base | |
validates_format_of :email, :with => /^(|(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6})$/i | |
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
NoMethodError in UsersController#create | |
undefined method `to_sym' for nil:NilClass | |
/home/david/.gem/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in `method_missing' | |
/home/david/Code/git/theindielist/app/controllers/users_controller.rb:45:in `create' | |
/home/david/.gem/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `send' | |
/home/david/.gem/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `perform_action_without_filters' | |
/home/david/.gem/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in `call_filters' | |
/home/david/.gem/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark' |
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
Processing UsersController#new (for 10.0.1.18 at 2010-07-07 15:22:14) [GET] | |
Parameters: {"action"=>"new", "controller"=>"users"} | |
User Columns (0.9ms) SHOW FIELDS FROM `users` | |
Rendering template within layouts/application | |
Rendering users/new | |
Rendered users/_form (3.5ms) | |
Rendered shared/_javascripts (6.3ms) | |
Completed in 190ms (View: 34, DB: 1) | 200 OK [http://dev.punkgrok.com/users/new/] | |
SQL (0.1ms) SET NAMES 'utf8' | |
SQL (0.1ms) SET SQL_AUTO_IS_NULL=0 |
OlderNewer