Skip to content

Instantly share code, notes, and snippets.

View JonRowe's full-sized avatar
💭
⛵️

Jon Rowe JonRowe

💭
⛵️
View GitHub Profile
@JonRowe
JonRowe / gist:c0861d56c69f2c8ab5d61988460dee32
Last active September 30, 2021 16:09 — forked from corbanb/gist:76d0658493e93830af48
Setting up PostGIS for Timezone Lookup

Forked from: corbanb/gist:76d0658493e93830af48 which borrowed heavily from http://blog.shupp.org/2012/08/12/local-timezone-lookups-by-coordinates-with-postgis/ to make this geared towards mac users, which has been updated.

Step 1: Install Postgresql & Postgis + dependencies

$ psql -U <user> -d template_postgis  
$ template_postgis=> select postgis_lib_version(); should return installed version!  
$ template_postgis=> \d+tz_world  

Hi, I'm Jon and I’m a freelance / contract Ruby / RoR developer based in Sydney;

I've been working with Ruby professionally for around 10 years, I consider myself a specialist in test driven development with Ruby, using Rails for customer facing sites (e.g. if it serves HTML). I'm one of the current maintainers of RSpec so as you can appreciate I'm a huge fan of using it for both unit and integration testing.

How can I help you? I have a lot of experience building prototype apps, polishing existing products, improving site performance, reviewing and improving code quality or improving test setups. Our work together could be a specific project or a time based contract. I typically work with the server side

@JonRowe
JonRowe / .rspec
Last active February 11, 2016 07:02
RubyConfAU16 Code
-r ./talk_helper
mkdir bash-fix
cd bash-fix
curl https://opensource.apple.com/tarballs/bash/bash-92.tar.gz | tar zxf -
cd bash-92/bash-3.2
curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-052 | patch -p0
curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-053 | patch -p0
cd ..
xcodebuild
sudo cp /bin/bash /bin/bash.old
sudo cp /bin/sh /bin/sh.old
@JonRowe
JonRowe / mbp.md
Last active August 29, 2015 14:04
For Sale! 15" Macbook Pro (Mid 2010)

15" Macbook Pro (Mid 2010)

I'm selling my Macbook Pro (Mid 2010), it has commited many many lines of code, it has written chunks of RSpec, it has fought the rubies and won. It has travelled 17000km to Australia and survived, but now it must be passed on to a worth successor.

The specs:

  • Display: 15" 1680x1050 display.
  • Processor: 2 core / 4 thread 2.66GHz Intel Core i7.
  • Memory: 8GB DDR3
  • Video card: PCIe 512MB NVIDIA GeForce GT 330M
@JonRowe
JonRowe / upgrade_ruby_pysch.rb
Created April 3, 2014 23:52
Updated script for updating psych. lul.
require 'json'
class Shell
def self.heroku_apps
new('heroku apps').cache_at 'heroku_app_cache'
end
def self.ruby_version app
new("heroku run \"ruby -v\" --app #{app}").cache_at "ruby_version_#{app}"
end
@JonRowe
JonRowe / pre-recieve-hook
Last active August 29, 2015 13:57
A git pre-receive hook for Ruby deploying.
#!/bin/bash
# Let's deploy...
echo "Deploying..."
echo "Deploying as: `whoami`"
# turn on failing script on any command fail
set -e
set -o pipefail
@JonRowe
JonRowe / db_spec_helper.rb
Last active August 29, 2015 13:57
Delay the slow things!
# An example used to segregate DB loading to those specs requiring it only.
RSpec.configure do |config|
config.include DBHelper::DB, db: true
config.include DSL::Setup, db: true
config.before(:all, db: true) do
DBHelper.load!
end
module B
def a
puts 'b'
super
end
end
class A
class << self; prepend B; end
def self.a
@JonRowe
JonRowe / heroku_ruby_yaml.rb
Created February 8, 2014 01:37
Update heroku apps running old versions of libyaml.
require 'json'
class Shell
def self.heroku_apps
new('heroku apps').cache_at 'heroku_app_cache'
end
def self.ruby_version app
new("heroku run \"ruby -v\" --app #{app}").cache_at "ruby_version_#{app}"
end