Skip to content

Instantly share code, notes, and snippets.

View Sutto's full-sized avatar

Darcy Laycock Sutto

View GitHub Profile
class StaticGoogleMap
URL_TEMPLATE = "http://maps.google.com/maps/api/staticmap?%s"
COLOURS = %w(red white green brown blue orange gray purple yellow black)
LABELS = ('A'..'Z').to_a
def initialize(options = {})
@addresses = []
@width, @height = options.fetch(:width, 540), options.fetch(:height, 400)
@params = returning({}) do |p|
p[:sensor] = false
#!/usr/bin/env bash
rsync_bin="/usr/bin/rsync"
rsync_args="--partial --delete -au"
sync_local_path="/Users/sutto/Code-Sync"
sync_remote_path="./Code-Sync"
sync_remote_hosts="[email protected]"
function path-with-trailing-slash {
echo "$1" | sed 's#/*$#/#'
rails_version() {
which -s rails && rails -v 2>/dev/null | sed 's/Rails //'
}
r() {
local name="$1"
shift
if [[ -z "$name" ]]; then
echo "Usage: $0 command *args" >&2
return 1
#!/usr/bin/env bash
if [[ -z "$1" ]] || [[ -z "$2" ]] ; then exit 1 ; fi
if [[ -n "$(echo "$1" | awk "/${2}/")" ]] ; then exit 0 ; else exit 1 ; fi

YouthTree Developer Overview

Organization Strategy

Currently, tools are documented typically in a relatively unorganized manner - Tim and I (Darcy) typically communicate over skype to discuss featueres and we have google docs with lists of items. We use a very ghetto method of marking progress (red means awaiting work, green is done) and to be honest it makes it hard to keep track of what is going on.

#!/usr/bin/env zsh
if [[ -s "${TM_PROJECT_DIRECTORY}/.rvmrc" ]]
then
source "${TM_PROJECT_DIRECTORY}/.rvmrc"
fi
exec ruby "$@"
set :default_environment, {
'PATH' => '/home/joey/.rvm/gems/ree-1.8.7-2010.02@vk/bin:/home/joey/.rvm/gems/ree-1.8.7-2010.02@global/bin:/home/joey/.rvm/rubies/ree-1.8.7-2010.02/bin:/home/joey/.rvm/bin:$PATH',
'RUBY_VERSION' => 'ree-1.8.7-2010.02',
'GEM_HOME' => '/home/joey/.rvm/gems/ree-1.8.7-2010.02@vk',
'GEM_PATH' => '/home/joey/.rvm/gems/ree-1.8.7-2010.02@vk:/home/joey/.rvm/gems/ree-1.8.7-2010.0@global',
'BUNDLE_PATH' => '/home/joey/.rvm/gems/ree-1.8.7-2010.02@vk' # If you are using bundler.
}
@Sutto
Sutto / setup_load_paths.rb
Created July 17, 2010 23:36
Automatic .rvmrc detection + bundler setup on passenger
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
rvm_lib_path = File.join(rvm_path, 'lib')
# Differentiate between new and old passenger versions
if File.exist?(File.join(rvm_lib_path, "rvm", "environment.rb"))
$LOAD_PATH.unshift rvm_lib_path
require 'rvm'
RVM.use_from_path! Dir.pwd # Passenger starts in the app root
end
end
#!/usr/bin/env bash
source "$HOME/.rvm/scripts/rvm"
if command -v __rvm_load_rvmrc >/dev/null; then
__rvm_load_rvmrc
fi
exec ruby "$@"