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
| # run with ruby -rubygems serve.rb | |
| require 'mongrel' | |
| h = Mongrel::HttpServer.new("0.0.0.0", "3000") | |
| h.register("/", Mongrel::DirHandler.new(File.dirname(__FILE__))) | |
| h.run.join |
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
| execute "create-application-database" do | |
| command "/usr/bin/mysql -u root -p#{node[:mysql][:server_root_password]} --exec='CREATE DATABASE IF NOT EXISTS `#{node[:company_name][:application_name][:database][:name]}`'" | |
| 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
| # Get a list of all MPs as a CSV file | |
| require 'rubygems' | |
| require 'hpricot' | |
| require 'open-uri' | |
| doc = Hpricot(open('http://www.parliament.uk/mpslordsandoffices/mps_and_lords/alms.cfm').read) | |
| mps = ((doc / "table").to_a[4] / "tr").to_a | |
| mps.shift |
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
| Kernel.module_eval do | |
| alias argh_eval eval | |
| def eval(*args) | |
| puts "QUIT USING EVAL DAMNIT" | |
| argh_eval(*args) | |
| 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
| %w{ apache2 apache2::mod_ssl apache2::mod_proxy_balancer apache2::mod_rewrite | |
| apache2::mod_expires }.each do |cb| | |
| depends cb | |
| 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
| #! /bin/bash | |
| GIT_BRANCH=$1 | |
| SVN_BRANCH=`basename $GIT_BRANCH` | |
| git checkout master > /dev/null | |
| git svn branch $SVN_BRANCH > /dev/null | |
| git svn fetch > /dev/null | |
| git branch -r |grep $SVN_BRANCH > /dev/null | |
| if [ "$?" != "0" ]; then |
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
| actionmailer (2.3.2, 2.2.2, 2.1.0, 2.0.2, 1.3.3) | |
| actionpack (2.3.2, 2.2.2, 2.1.0, 2.0.2, 1.13.3) | |
| actionwebservice (1.2.3) | |
| activerecord (2.3.2, 2.2.2, 2.1.0, 2.0.2, 1.15.3) | |
| activeresource (2.3.2, 2.2.2, 2.1.0, 2.0.2) | |
| activesupport (2.3.2, 2.2.2, 2.1.0, 2.0.2, 1.4.2) | |
| ar_mailer (1.3.1) | |
| archive-tar-minitar (0.5.1) | |
| aws-s3 (0.4.0) | |
| BlueCloth (1.0.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
| # app/models/physical/organisation.rb | |
| module Physical | |
| class Organisation < ActiveRecord::Base | |
| validates :foo, :bar, :baz, :quuz | |
| end | |
| end | |
| # app/models/physical/user.rb | |
| module Physical | |
| class User < ActiveRecord::Base |
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
| # how to test that this works? | |
| # or would you even bother? | |
| ... | |
| begin | |
| require 'system_timer' | |
| rescue LoadError | |
| require 'timeout' | |
| SystemTimer = Timeout |
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
| <li typeof="event:Event" id="lrug" about="http://lrug.org/#meeting"> | |
| <h2 rel="event:agent"><a typeof="foaf:Group" property="foaf:name" rel="foaf:homepage" href="http://lrug.org/">LRUG</a></h2> | |
| <p class="who">Rubyists</p> | |
| <p property="event:Time" class="when">Second Wednesday</p> | |
| </li> |