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
<? | |
// Tide class fetches, caches and returns tide data from waterlevels.gc.ca | |
// Kenzie Campbell <[email protected]> | |
// Feb. 9, 2010 | |
class Tide | |
{ | |
// instance variables (w/ defaults) |
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
<? | |
// Quicksilver Score | |
// | |
// A port of the Quicksilver string ranking algorithm | |
// (re-ported from Javascript to PHP by Kenzie Campbell) | |
// http://route19.com/logbook/view/quicksilver-score-in-php | |
// | |
// score("hello world","axl") //=> 0.0 | |
// score("hello world","ow") //=> 0.6 |
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 'rubygems' | |
require 'net/ssh' | |
# VERSION 0.2 | |
# 0.2 – 2010/05/26 : added cleanup (rm deploy) | |
# 0.1 – 2010/05/21 : initial setup | |
HOST = "domain.com" | |
USER = "username" | |
PASSWORD = nil |
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
# open Terminal.app | |
# sudo crontab -e | |
[email protected] | |
# networksetup -setairportnetwork <network> <device name> [password] | |
0 9 * * 1-5 /usr/sbin/networksetup -setairportnetwork AirPort "3G" "password" | |
0 17 * * 1-5 /usr/sbin/networksetup -setairportnetwork AirPort "DSL" "password" |
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 String | |
# adds tabs to the beginning of each line | |
def indent(tabs=4) | |
self.gsub(/^/, "\t"*tabs) | |
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
# wrap errors in span | |
config.action_view.field_error_proc = Proc.new { |html_tag, instance| "<span class=\"field_with_errors\">#{html_tag}</span>".html_safe } |
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
source 'http://rubygems.org' | |
gem 'rails', '3.1.0' | |
gem 'jquery-rails' | |
group :assets do | |
gem 'sass-rails', " ~> 3.1.0" | |
gem 'coffee-rails', "~> 3.1.0" | |
gem 'uglifier' | |
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
<% if target.errors.any? %> | |
<div class="error_explanation"> | |
<h2><%= pluralize(target.errors.count, "error") %> prevented this record from being saved:</h2> | |
<ul> | |
<% target.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% 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
# add these aliases to your BASH profile ~/.profile | |
alias mongodb-start="mongod run --config /usr/local/etc/mongod.conf" | |
alias redis-start="redis-server /usr/local/etc/redis.conf" | |
# TODO add stop commands |
OlderNewer