Skip to content

Instantly share code, notes, and snippets.

Rob Hurring robhurring

Block or report user

Report or block robhurring

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View search_terms.rb
# Search term parser from
# Modified to allow periods (and other non-letter chars) in unquoted field values
# and field names.
# Helper class to help parse out more advanced saerch terms
# from a form query
# Note: all hash keys are downcased, so ID:10 == {'id' => 10}
# you can also access all keys with methods e.g.: = terms['id'] = 10
# this doesn't work with query as thats reserved for the left-over pieces
robhurring / geolookup.js
Created Oct 8, 2014
Geolocation zip code lookup using google maps and angular. (Demo:
View geolookup.js
(function(angular) {
'use strict';
var app = angular.module('MyApp', []);
app.factory('GeolocationSvc', [
'$q', '$window',
function($q, $window) {
return function() {
var deferred = $q.defer();
robhurring / shBrushRuby.js
Created Jul 17, 2009
GitHub style syntax highlighter theme
View shBrushRuby.js
* SyntaxHighlighter
* SyntaxHighlighter is donationware. If you are using it, please donate.
* @version
* 2.0.320 (May 03 2009)
robhurring / Rakefile
Created Dec 7, 2010
Delayed Job with Sinatra -- without sinatra specific gems, etc.
View Rakefile
task :environment do
require './dj-sinatra'
namespace :jobs do
desc "Clear the delayed_job queue."
task :clear => :environment do
robhurring / fb-token-refresh
Created Jun 15, 2016
long lived facebook access token
View fb-token-refresh
#!/usr/bin/env sh
# Turn a short-lived access token into a long(er) lived access token.
# To use this you must first generate a short-lived access token using the
# graph API (
# NOTE: make sure you select your app under the "Application" dropdown. if you
# don't you will see an error from this saying something about your app and
# not having permission/access
robhurring / app.rb
Created Nov 23, 2010
ActiveRecord query caching with Sinatra
View app.rb
# ActiveRecord refuses to enable query caching _unless_ you have the following setup
# 1) you _must_ use ActiveRecord::Base.configurations to store your auth details
# 2) you _must_ include the ActiveRecord::QueryCache middleware
# 3) you _must_ inherit from the _Base_ connection -- abstract models don't
# cache without a bit of hacking, it only query caches anything from AR::Base
require 'sinatra'
require 'active_record'
# query caching requires that you use AR::Base.configurations to store your
robhurring /
Created Oct 22, 2012
Simple bind/trigger mixin for javascript object
# this: in coffeescript, without the global stuff...
class EventsDispatcher
callbacks: {}
bind: (event_name, callback) ->
@callbacks[event_name] ||= []
@callbacks[event_name].push callback
trigger: (event_name, data) ->
robhurring / main.rb
Last active Jul 12, 2016
Lightweight actors in ruby
View main.rb
require 'thread'
module Actor
class << self
def included(base)
def current

Keybase proof

I hereby claim:

  • I am robhurring on github.
  • I am robh ( on keybase.
  • I have a public key whose fingerprint is 433D 3918 FF86 850F 4293 9BB4 9957 F49F 5C33 DE2A

To claim this, I am signing this object:

robhurring /
Last active Mar 3, 2016
Angular geolocation wrapper service
You can’t perform that action at this time.