Skip to content

Instantly share code, notes, and snippets.

John Hirbour jhirbour

Block or report user

Report or block jhirbour

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
jhirbour /
Created Oct 11, 2019
creating talk rails log for SLUG !!!
2.5.3 :022 > t = Talk.create(headline: 'TED RURAL IS NOT A THING YET2', speaker_name: 'John Hirbour2', primary_almanac_language_code_id: 35)
D, [2019-10-11T11:46:10.623517 #29913] DEBUG -- :    (0.4ms)  BEGIN
D, [2019-10-11T11:46:10.627712 #29913] DEBUG -- :   Talk Exists (0.8ms)  SELECT  1 AS one FROM `talks` INNER JOIN `friendly_id_slugs` ON `friendly_id_slugs`.`sluggable_id` = `talks`.`id` AND `friendly_id_slugs`.`sluggable_type` = 'Talk' WHERE `talks`.`id` IS NOT NULL AND `talks`.`slug` = 'john_hirbour2_ted_rural_is_not_a_thing_yet2' LIMIT 1
D, [2019-10-11T11:46:10.630214 #29913] DEBUG -- :   Talk Exists (0.7ms)  SELECT  1 AS one FROM `talks` INNER JOIN `friendly_id_slugs` ON `friendly_id_slugs`.`sluggable_id` = `talks`.`id` AND `friendly_id_slugs`.`sluggable_type` = 'Talk' WHERE `talks`.`id` IS NOT NULL AND `friendly_id_slugs`.`sluggable_type` = 'Talk' AND `friendly_id_slugs`.`slug` = 'john_hirbour2_ted_rural_is_not_a_thing_yet2' LIMIT 1
D, [2019-10-11T11:46:10.632076 #29913] DEBUG -- :   TalkType L
jhirbour / me-mux
Created Jan 27, 2017
Create a Named Tmux session, named the same as the directory you're currently in.
View me-mux
#PROJECT_NAME=`basename $PWD`
PROJECT_NAME=`basename $PWD | tr '.' '-'`
tmux has-session -t $PROJECT_NAME 2>/dev/null
if [ "$?" -eq 1 ] ; then
echo "No Session found. Creating and configuring."
tmux new-session -d -s $PROJECT_NAME

Keybase proof

I hereby claim:

  • I am jhirbour on github.
  • I am jhirbour ( on keybase.
  • I have a public key whose fingerprint is B7F7 861E C8BE 0D35 28BB 1854 305C E94C 4CEC D7F2

To claim this, I am signing this object:

jhirbour /
Last active Sep 11, 2015
PGSQL finding if rows have other rows in a time range near them

I'm trying to find rows in a table where there have been other rows created within a minute of them.

Why you can't use group by:

You can't use group by for this because certain rows will exist inside of 2 groups.

 timestamp                      minute logical group
2010-01-01 09:09:01             A1
2010-01-01 09:09:58             A1, A2
jhirbour / clean my spree
Last active Apr 16, 2019
Code to empty a spree database of product/taxons/orders
View clean my spree
#### DON'T RUN THIS ON YOUR PRODUCTION DATA!!!! It will delete stuff !!!!!!
# clear product data { |p| p.destroy! } { |v| v.destroy! } { |si| si.destroy! }
# clear taxonomies and Taxons
# double check that this deletes from spree_taxons and spree_taxonomies
jhirbour / gist:6800583
Created Oct 2, 2013
In Spree: Replace t/taxon_name with category/taxon_name
View gist:6800583

Create or edit: $APP_ROOT/app/helpers/spree/base_helper_decorator.rb

Add this:

Spree::BaseHelper.module_eval do
  def seo_url(taxon)
    return main_app.categories_path(taxon.permalink)
jhirbour / ror_os_x
Last active Dec 22, 2015
Getting RoR up and running on OS X
View ror_os_x
How to get RoR running on OS X.
# Supported OS
OS X: 10.8.4
* None of these commands should be run as root. Run them as the user you want to do devlopment as. There ARE steps where you'll be prompted for your password.
* you SHOULD NOT have mysql installed locally if you intend to use this guide... if you do the "brew install mysql" commands may break it...
You can’t perform that action at this time.