Skip to content

Instantly share code, notes, and snippets.

View peteonrails's full-sized avatar

Peter Jackson peteonrails

View GitHub Profile

Keybase proof

I hereby claim:

  • I am peteonrails on github.
  • I am peteonrails (https://keybase.io/peteonrails) on keybase.
  • I have a public key whose fingerprint is FE84 3C89 4168 5E39 32A7 AA20 09B9 F8AD 6B44 9A71

To claim this, I am signing this object:

@peteonrails
peteonrails / v1
Created March 13, 2012 17:48 — forked from adambair/v1
-------------------------------------------------------------
iIIIIIIIIIIIIIIi,
II 'IIi. Intridea, Inc
II 'Ii www.intridea.com
II iii II
II 'ii II Document Title Here
II II 12/05/2011 - 12/06/2011
II iii II
II. iii .II Adam Bair, Partner
@peteonrails
peteonrails / QGIS cmake in homebrew
Created January 31, 2012 18:33 — forked from cspanring/QGIS cmake in homebrew
homebrew formula cmake arguments and output for QGIS.
cmake -DCMAKE_INSTALL_PREFIX=~/Applications -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=MinSizeRel -DWITH_INTERNAL_SPATIALITE=TRUE -DGEOS_INCLUDE_DIR=/usr/local/Cellar/geos/3.2.2/include -DGEOS_LIBRARY=/usr/local/Cellar/geos/3.2.2/lib/libgeos_c.dylib -DGDAL_INCLUDE_DIR=/usr/local/Cellar/gdal/1.7.3/include -DGDAL_LIBRARY=/usr/local/Cellar/gdal/1.7.3/lib/libgdal.dylib -DPYTHON_EXECUTABLE=/usr/local/Cellar/python/2.7.1/bin/python -DSIP_BINARY_PATH=/usr/local/bin/sip -DSIP_INCLUDE_DIR=/usr/local/include -DSIP_FOUND=true -DQWT_INCLUDE_DIR=/usr/local/Cellar/qwt/6.0.1/lib/qwt.framework/Versions/Current/Headers
-- Quantum GIS version: 1.9.90 Alpha (10990)
-- Could not find GRASS
-- Found Iconv: /usr/lib/libiconv.dylib
-- Found Proj: /usr/local/lib/libproj.dylib
-- Found GEOS: /usr/local/Cellar/geos/3.2.2/lib/libgeos_c.dylib
-- Found GDAL: /usr/local/Cellar/gdal/1.7.3/lib/libgdal.dylib
-- Found Expat: /usr/lib/libexpat.dylib
-- Found Qwt: /usr/local/lib/qwt.framework (6.0.1)
-- Found PostgreSQL: /usr/local/Cellar/po
@peteonrails
peteonrails / production
Created January 14, 2012 20:23
Cap deploy for Studyhall
Pete@Templar /Volumes/Templar SATA/workspace/web/studyhall (master) ⚡
→ cap production deploy
* executing `production'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
triggering before callbacks for `deploy'
* executing `deploy:setup_ssh'
Enter passphrase for /Users/Pete/.ssh/id_rsa:
Identity added: /Users/Pete/.ssh/id_rsa (/Users/Pete/.ssh/id_rsa)
@peteonrails
peteonrails / rev.c
Created January 10, 2012 15:47
Reverse an Integer in C
// I am not sure why I get asked to do this so frequently,
// but here is how I do it.
#include <stdio.h>
int main () {
int backwards = 0;
int value = 12345678;
int orig = value;
do
backwards = (backwards * 10) + (value % 10) ;
@peteonrails
peteonrails / geos
Created November 10, 2011 22:34
Updating the Homebrew formula for geos, when Mac OS X Lion complains about LLVM / gcc-4.2
require 'formula'
class Geos < Formula
url 'http://download.osgeo.org/geos/geos-3.3.1.tar.bz2'
homepage 'http://trac.osgeo.org/geos/'
md5 'b1ceefe205c9ee520b99f2b072c345f7'
def skip_clean? path
path.extname == '.la'
end
#----------------------------------------------------------------------------
# Git Setup
#----------------------------------------------------------------------------
file '.gitignore', <<-FILE
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
public/uploads/*
// For Aaron
// You can replace the passed anonymous function with a callback if you'd rather.
<script src="/javascripts/prototype.js" type="text/javascript"></script>
<script type='text/javascript'>
new PeriodicalExecuter(function(pe) {
if (!confirm('Want me to annoy you again later?'))
pe.stop();
}, 5);
# wesbos:
# make sure you have Ruby and Rubygems installed
# Get the twitter gem with 'gem install twitter'
# Then, run irb and type this code
Twitter.follower_ids('peteonrails').each { |f| puts Twitter.follower_ids(f).count }
# If you'd rather have a total, do this:
Twitter.follower_ids('peteonrails').inject { |memo, f| memo += Twitter.follower_ids(f).count }
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto