Skip to content

Instantly share code, notes, and snippets.

View JonRowe's full-sized avatar
💭
⛵️

Jon Rowe JonRowe

💭
⛵️
View GitHub Profile
<script type="text/javascript">
// FORK IDEA
// By wrapping in try catch you can fallback to Typekit's default JS if they change the experimental feature.
try
{
// *** EXPERIMENTAL ***
//
// This is an experimental method to be notified when Typekit's fonts have loaded.
if expand('%') =~# '_spec\.rb$'
syn keyword rubyRspec describe context it specify it_should_behave_like before after setup subject its shared_examples_for shared_context let
endif
hi def link rubyRspec Function
@JonRowe
JonRowe / sketch.rb
Created June 29, 2012 16:04 — forked from mattwynne/sketch.rb
sketch for Matt Wynne
class Organization
def to_param
"42"
end
def saved?
rand > 0.5
end
end
class OrganizationResponder
1.9.3p448 :002 > a = [-> { puts 1; true }, -> { puts 2; false}, -> { puts 3; false }]
=> [#<Proc:0x007fe5c41a8f68@(irb):2 (lambda)>, #<Proc:0x007fe5c41a8f18@(irb):2 (lambda)>, #<Proc:0x007fe5c41a8ef0@(irb):2 (lambda)>]
1.9.3p448 :003 > a.all?(&:call)
1
2
=> false
1.9.3p448 :004 > a = [-> { puts 1; false }, -> { puts 2; true}, -> { puts 3; false }]
=> [#<Proc:0x007fe5c4276620@(irb):4 (lambda)>, #<Proc:0x007fe5c42765d0@(irb):4 (lambda)>, #<Proc:0x007fe5c42765a8@(irb):4 (lambda)>]
1.9.3p448 :005 > a.any?(&:call)
1
@JonRowe
JonRowe / active.md
Last active December 28, 2015 15:08 — forked from parndt/active.md

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Sat, 17 Nov 2012 22:58:25 GMT till Sun, 17 Nov 2013 22:58:25 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter((user) -&gt; user.followers &gt; 30)
@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