- see https://gist.github.com/machty/5723945 for the latest API (unlikely to change from now on)
- latest Ember build: https://machty.s3.amazonaws.com/ember/ember-async-routing-10.js
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
# from here http://blog.55minutes.com/2013/09/postgresql-93-brew-upgrade/ | |
# Create backup of database | |
/usr/local/cellar/postgresql/9.2.4/bin/pg_dump -h localhost -p 5432 -U ab428 -Fc -b -v -f "/usr/local/var/pg_backup/afghanistan.backup" afghanistan | |
# Upgrade PostGIS | |
brew doctor # fix errors | |
brew update | |
brew upgrade postgres | |
brew upgrade gdal --with-postgres |
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 python | |
# ndvi.py red.tif nir.tif output-ndvi.tif | |
# Calculate NDVI (see Wikipedia). Assumes atmospheric correction. | |
# (Although I use it without all the time for quick experiments.) | |
import numpy as np | |
from sys import argv | |
from osgeo import gdal, gdalconst |
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
- name: create user $user | |
action: user name=$user | |
- name: download rbenv-installer for $user | |
action: get_url url=https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer dest=/tmp/rbenv-installer mode=0755 | |
- name: run rbenv-installer | |
action: raw HOME=/home/$user /tmp/rbenv-installer | |
- name: copy rbenv environment setup |
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
# Environment, set GEM_HOME & GEM_PATH. For example, we can launch JRuby like this: | |
# GEM_HOME=/Users/amurray/tmp/gems/ GEM_PATH=/Users/amurray/tmp/gems java -jar ~/Downloads/jruby-complete-1.7.0.preview1.jar -S irb | |
# ===================== | |
# LISTING gems | |
puts Gem::Specification.find_all.to_s | |
puts Gem::Specification.find_all.map{|spec| "#{spec.name} (#{spec.version})" } | |
# ===================== | |
# USING (a specific version of) gems |
This is how we test that all translation keys match up between locales.
Stuff that only goes in one locale (such as an admin section) or that can't be translated yet (if you use external translators) can simply go in files that don't match the path "config/locales/??.yml", like "config/locales/wip.fo.yml".
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
This playbook has been removed as it is now very outdated. |
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
#!/bin/sh | |
SESSION_NAME="big_red" | |
cd ~/Sites/within3/big_red | |
tmux has-session -t ${SESSION_NAME} | |
if [ $? != 0 ] | |
then |
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
# put the file into spec/support | |
shared_examples_for "ActiveModel" do | |
include ActiveModel::Lint::Tests | |
# to_s is to support ruby-1.9 | |
ActiveModel::Lint::Tests.public_instance_methods.map{|m| m.to_s}.grep(/^test/).each do |m| | |
example m.gsub('_',' ') do | |
send m | |
end | |
end |