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
module Harmony | |
# Allows accessing config variables from harmony.yml like so: | |
# Harmony[:domain] => harmonyapp.com | |
def self.[](key) | |
unless @config | |
raw_config = File.read(RAILS_ROOT + "/config/harmony.yml") | |
@config = YAML.load(raw_config)[RAILS_ENV].symbolize_keys | |
end | |
@config[key] | |
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
set theIP to do shell script "curl -sf http://checkip.dyndns.org/|cut -d ':' -f 2|cut -d '<' -f1|sed -e 's/ //g'" | |
tell application "LaunchBar" | |
display in large type theIP with title "External IP Address:" | |
end tell | |
return theIP |
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
shared: &shared | |
# Use different adapters with JRuby vs. MRI | |
adapter: <%= defined?(JRuby) ? "jdbcmysql" : "mysql" %> | |
encoding: utf8 | |
username: root | |
password: | |
host: localhost | |
socket: /opt/local/var/run/mysql5/mysqld.sock | |
<% |
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
RE="ruby-enterprise-1.8.6-20081215" | |
PREFIX=/opt/$RE | |
VERSION=2.0.6 | |
GEM_PATH="$PREFIX/lib/ruby/gems/1.8/gems/passenger-$VERSION" | |
DOMAIN=odpiralnicasi.com | |
APP_ROOT=/srv/oc | |
# install Apache2 | |
apt-get install -qq apache2 apache2-prefork-dev |
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
# in config/routes.rb | |
map.connect '', :controller => 'domain_tests', :action => 'domain1', :conditions => {:hostname => "domain1"} | |
map.connect '', :controller => 'domain_tests', :action => 'domain2', :conditions => {:hostname => "domain2"} | |
# in config/environment.rb after the initialize section | |
module ActionController | |
module Routing | |
class RouteSet | |
def extract_request_environment(request) | |
{ :method => request.method, :hostname => request.domain.split('.').first } |
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/env perl | |
# | |
# Copyright (c) 2009 Michelle Steigerwalt <msteigerwalt.com> | |
# All rights reserved. | |
# | |
# Upgraded to metric system by Fredrik Bränström <branstrom.name> | |
# | |
# Handy-dandy tea brewing timer. Uses Growl for messaging. | |
# | |
# Normal Mode: |
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/env perl | |
# | |
# Copyright (c) 2009 Michelle Steigerwalt <msteigerwalt.com> | |
# All rights reserved. | |
# | |
# Handy-dandy tea brewing timer. Uses Growl for messaging. | |
# | |
# Normal Mode: | |
# > brew oolong | |
# Steeping for five minutes. |
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 Project < ActiveRecord::Base | |
def self.find(*args) | |
options = args.extract_options! | |
if not options.include? :order | |
options[:order] = 'finished_at desc' | |
end | |
args.push(options) | |
super | |
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
fredrik@Benton ‣ svn co http://svn.ruby-lang.org/repos/ruby/tags/v1_8_6_111/ext/readline/ readline | |
A readline/depend | |
A readline/readline.c | |
A readline/README.ja | |
A readline/extconf.rb | |
A readline/.cvsignore | |
A readline/README | |
U readline | |
Checkade ut revision 20886. | |
fredrik@Benton ‣ readline ~/Code/RoR |
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
namespace :spec do | |
namespace :db do | |
namespace :fixtures do | |
desc 'Create YAML spec fixtures from data in an existing database. Defaults to development database. Set RAILS_ENV to override. You can also set tables to dump with rake spec:db:fixtures:dump TABLES=posts,pages' | |
task :dump => :environment do | |
sql = "SELECT * FROM %s" | |
skip_tables = ["schema_info", "schema_migrations"] | |
ActiveRecord::Base.establish_connection(RAILS_ENV) |