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
Verifying my Blockstack ID is secured with the address 17iQGorAodsKtNGZqxYkfohDJwY2gF5NEF https://explorer.blockstack.org/address/17iQGorAodsKtNGZqxYkfohDJwY2gF5NEF |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the unicorn app server | |
# Description: starts unicorn using start-stop-daemon |
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 tab() { | |
local args="$@" | |
osascript &>/dev/null <<EOF | |
tell application "iTerm" | |
tell current terminal | |
launch session "Default Session" | |
tell the last session | |
write text "$args" | |
end tell |
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 "rspec" | |
class Train | |
attr_reader :carriages, :percent_reserved_barrier | |
def initialize(carriages) | |
@carriages = carriages | |
@percent_reserved_barrier = 70 | |
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
require "rspec" | |
class Buyer | |
attr_accessor :cart, :money | |
def initialize | |
@cart = [] | |
@money = 0 | |
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
--- 1/method_missing_gotcha-01.rb | |
+++ 2/method_missing_gotcha-02.rb | |
@@ -9,6 +9,8 @@ class RadioActive | |
def method_missing(name, *args) | |
if name.to_s =~ /^to_(\w+)$/ | |
to_format($1) | |
+ else | |
+ super | |
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
net = require 'net' | |
server = net.createServer() | |
broadcast = (client, data) -> | |
client.write(data) if client.writable | |
for_others = (everyone, me, func) -> | |
func(other) for other in everyone when me != other | |
remove_me = (everyone, me) -> |
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
>> h = Hash[ 'a', 1, 'b', 2 ] | |
=> {["a", 1]=>["b", 2]} | |
>> h = Hash[ [ ['a', 1], ['b', 2] ] ] | |
=> {"a"=>1, "b"=>2} | |
>> h = Hash[ 'a' => 1, 'b' => 2 ] | |
=> {"a"=>1, "b"=>2} | |
>> h = { 'a' => 1, 'b' => 2 } |
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 = 'hello world' | |
=> "hello world" | |
>> s =~ /wor/ | |
=> 6 | |
>> s =~ /wok/ | |
=> nil | |
>> s.scan(/wor/) | |
=> ["wor"] |
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
development: | |
adapter: <%= defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3' %> | |
database: db/development.sqlite3 | |
pool: 5 | |
timeout: 5000 | |
production: | |
adapter: <%= defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3' %> | |
database: /home/greg/dev/railsjam/db/development.sqlite3 | |
pool: 5 |
NewerOlder