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
Vagrant::Config.run do |config| | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "precise64" | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
config.vm.define :gitlab do |gitlab| | |
gitlab.vm.network :hostonly, "10.10.10.100" | |
gitlab.vm.provision :chef_solo do |chef| | |
chef.cookbooks_path = ["cookbooks", "site-cookbooks"] |
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/ruby | |
require 'net/http' | |
require 'net/https' | |
require 'base64' | |
require 'uri' | |
require 'yaml' | |
require 'cgi' | |
module Configuration | |
def config_file |
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/ruby | |
require 'net/http' | |
require 'net/https' | |
require 'base64' | |
require 'uri' | |
require 'yaml' | |
require 'cgi' | |
class Net::HTTP | |
alias_method :old_initialize, :initialize |
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
<div class="container"> | |
<div class="span4"></div> | |
<div class="span8"> | |
<div class="row"> | |
<div class="span2">sidebar</div> | |
<div class="span9">main</div> | |
</div> | |
</div> | |
</div> |
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
Show hidden characters
// This file lives @ /Library/Application Support/Sublime Text 2/Packages/User/RubyTest.sublime-build | |
{ | |
"ruby_unit_exec": "~/bin/rvm_ruby ruby -Itest", | |
"ruby_cucumber_exec": "~/bin/rvm_ruby cucumber --no-color", | |
"ruby_rspec_exec": "~/bin/rvm_ruby rspec", | |
"ruby_unit_folder": "test", | |
"ruby_cucumber_folder": "features", | |
"ruby_rspec_folder": "spec" | |
} |
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 Episode < ActiveRecord::Base | |
scope :airs_at_in_future, lambda{ where('episodes.airs_at > ?', Time.zone.now) } | |
scope :airs_at_in_past, lambda{ where('episodes.airs_at < ?', Time.zone.now) } | |
# will cache Time.now | |
scope :next_airing, airs_at_in_future.order('episodes.airs_at asc') | |
scope :last_aired, airs_at_in_past.order('episodes.airs_at desc') | |
# will not cache Time.now | |
scope :next_airing, lambda{ airs_at_in_future.order('episodes.airs_at asc') } |
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 'net/http' | |
html = Net::HTTP.get(URI.parse('http://www.w3schools.com/XML/note.xml')) | |
hash = Hash.from_xml( html ) | |
puts html.inspect | |
puts hash.inspect |
NewerOlder