Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
⛵️

Jon Rowe JonRowe

💭
⛵️
View GitHub Profile
@JonRowe
JonRowe / gist:c0861d56c69f2c8ab5d61988460dee32
Last active Mar 3, 2020 — forked from corbanb/gist:76d0658493e93830af48
Setting up PostGIS for Timezone Lookup
View gist:c0861d56c69f2c8ab5d61988460dee32

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  
View blurb.md

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 Feb 11, 2016
RubyConfAU16 Code
View .rspec
-r ./talk_helper
View bash-fix.sh
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 Aug 29, 2015
For Sale! 15" Macbook Pro (Mid 2010)
View mbp.md

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 Apr 3, 2014
Updated script for updating psych. lul.
View upgrade_ruby_pysch.rb
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 Aug 29, 2015
A git pre-receive hook for Ruby deploying.
View pre-recieve-hook
#!/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 Aug 29, 2015
Delay the slow things!
View db_spec_helper.rb
# 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
View prepend_class.rb
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 Feb 8, 2014
Update heroku apps running old versions of libyaml.
View heroku_ruby_yaml.rb
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
You can’t perform that action at this time.