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
Used this to build ruby-2.0.0 on Ubuntu 14.04. The command was: | |
rbenv install --patch 2.0.0-p353 < ruby-2.0.0.diff | |
Ref: https://github.com/sstephenson/ruby-build/issues/526#issuecomment-37932244 | |
diff -ur ext/readline/readline.c ext/readline/readline.c | |
--- ext/readline/readline.c 2014-03-18 13:53:31.866359527 +0100 | |
+++ ext/readline/readline.c 2014-03-18 13:56:26.390247250 +0100 | |
@@ -1883,7 +1883,7 @@ |
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
# Include this module into your fake models to get some helpful default functionality. | |
# | |
# Example usage: | |
# | |
# class AuxiliaryOfficer | |
# include FakeModel | |
# | |
# attr_accessor :name, :started_on, :comments | |
# | |
# def self.fake_attributes |
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
# A helper for determining which partner site we're on. This can be | |
# used for setting a CSS class on the body tag in the layout, or | |
# for referencing namespaced assets or translations. | |
def parner(host=request.host) | |
if $ENV['PARTNER'] == 'graduate' || host =~ /graduate/i | |
'graduate' | |
elsif $ENV['PARTNER'] == 'schreyer' || host =~ /schreyer/i | |
'schreyer' | |
else | |
# decide whether to fail or default to one of the above |
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
irb(main):006:0* class Dog | |
irb(main):007:1> def bark | |
irb(main):008:2> puts "Ruff!!" | |
irb(main):009:2> end | |
irb(main):010:1> def age | |
irb(main):011:2> 12 | |
irb(main):012:2> end | |
irb(main):013:1> end | |
=> :age | |
irb(main):014:0> |
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
# This lives in config/initializers/current_partner.rb | |
# A global method to return the current partner | |
def current_partner | |
Partner.current | |
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
class User | |
has_many :things | |
has_many :sub_things, through: :things | |
has_many :sub_sub_things, through: :sub_things | |
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
~/westarete/src/flip-learning | 30248d7 | master | |
[532] $ echo 'puts "hi"' > hello.rb | |
~/westarete/src/flip-learning | 30248d7 | master* | |
[533] $ irb | |
irb(main):001:0> require 'hello' | |
LoadError: cannot load such file -- hello | |
from /Users/woods/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' | |
from /Users/woods/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' | |
from (irb):1 |
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
$ echo 'puts "hi"' > hello.rb | |
$ irb | |
irb(main):001:0> require 'hello' | |
LoadError: cannot load such file -- hello | |
from /Users/woods/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' | |
from /Users/woods/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' | |
from (irb):1 | |
from /Users/woods/.rbenv/versions/2.2.2/bin/irb:11:in `<main>' |
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
<div id="wufoo-p1nx3plw0skd0cb"> | |
Fill out my <a href="https://westarete.wufoo.com/forms/p1nx3plw0skd0cb">online form</a>. | |
</div> | |
<script type="text/javascript">var p1nx3plw0skd0cb;(function(d, t) { | |
var s = d.createElement(t), options = { | |
'userName':'westarete', | |
'formHash':'p1nx3plw0skd0cb', | |
'autoResize':true, | |
'height':'620', | |
'async':true, |
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
#!/usr/bin/env ruby | |
require 'yaml' | |
puts "How many sections?" | |
number_of_sections = Integer(gets) | |
data = YAML.load(DATA) | |
data['start'] = data['end'] + 1 | |
data['end'] += number_of_sections |