- Install Virtualbox
- Install XCode and the Command Line Tools
This file contains hidden or 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::Specification.new do |s| | |
s.name = 'value' | |
s.version = '1.0.0.alpha' | |
s.description = 'value' | |
s.summary = 'value' | |
s.licenses = ['MIT'] | |
s.homepage = 'https://gist.github.com/wojtekmach/5fb83f9dc97a02e9851a' | |
s.authors = ['Wojtek Mach'] | |
s.email = ['[email protected]'] |
This file contains hidden or 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 'anima' | |
class AnimaExt < Anima | |
module ClassMethods | |
def [](hash) | |
new(hash) | |
end | |
end | |
module InstanceMethods |
This file contains hidden or 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
foo |
This file contains hidden or 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
# >> color = Enum.new("red", "green", "blue") | |
# >> color.values | |
# => ["red", "green", "blue"] | |
# >> color["red"] | |
# => "red" | |
# >> color["yellow"] | |
# ArgumentError: Invalid value: "yellow". Allowed: "red", "green", "blue". | |
class Enum | |
def initialize(*values) | |
@values = values |
This file contains hidden or 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
# Based on: https://gist.github.com/tmertens/9a3355c3c9a04d537a34 | |
require 'benchmark/ips' | |
class Tester | |
def self.it(description) | |
description | |
end | |
def self.metadata |
This file contains hidden or 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
diff --git a/foo.rb b/foo.rb | |
index f23ba09..ff04a22 100644 | |
--- a/foo.rb | |
+++ b/foo.rb | |
@@ -1,11 +1,13 @@ | |
a = [ | |
1, | |
2, | |
- 3 | |
+ 3, |
This file contains hidden or 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
module ActiveSupport::JSON::Encoding | |
class JSONGemEncoder | |
# See: https://github.com/rails/rails/blob/8f15565de879bd40c8390884d1d31e52de240323/activesupport/lib/active_support/json/encoding.rb#L95 | |
def stringify(jsonified) | |
::JSON.pretty_generate(jsonified, quirks_mode: true, max_nesting: false) + "\n" | |
end | |
end | |
end |
This file contains hidden or 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
# based on https://github.com/basecamp/pow/issues/428 | |
if [ -f "$rvm_path/scripts/rvm" ]; then | |
source "$rvm_path/scripts/rvm" | |
fi | |
if [ -f ".rvmrc" ]; then | |
source ".rvmrc" | |
fi |
I hereby claim:
- I am wojtekmach on github.
- I am wojtekmach (https://keybase.io/wojtekmach) on keybase.
- I have a public key whose fingerprint is BB14 74F7 937F 0321 39C7 7054 C3DA D70E 5262 D2F5
To claim this, I am signing this object: