Skip to content

Instantly share code, notes, and snippets.

View jeremywadsack's full-sized avatar

Jeremy Wadsack jeremywadsack

View GitHub Profile
@jeremywadsack
jeremywadsack / covertToLocalDate.js.coffee
Created July 14, 2015 23:28
Covert UTC time to local time on browser
# A jQuery plugin to convert UTC times to local times on the browser.
#
# You can apply this to any element on the page like this:
#
# $('#message').covertToLocalDate();
#
# This looks for one or more date-time strings in the original element
# and replaces them. The existing dates must be in the format
# 2015-07-14 16:30:00 UTC
# It replaces them with an <abbr> element (which is usually styled with
@jeremywadsack
jeremywadsack / rails_3.2.19
Created November 25, 2014 23:01
Postgres logs from rspec run under rails 3.2.19 and 4.1.8
[unknown]LOG: connection received: host=::1 port=58397
my-app-test LOG: connection authorized: user=jeremywadsack database=my-app-test
my-app-test LOG: statement: set client_encoding to 'UTF8'
my-app-test LOG: statement: set client_encoding to 'utf8'
my-app-test LOG: statement: SET client_min_messages TO 'WARNING'
my-app-test LOG: statement: SHOW client_min_messages
my-app-test LOG: statement: SET client_min_messages TO 'panic'
my-app-test LOG: statement: SET standard_conforming_strings = on
my-app-test LOG: statement: SET client_min_messages TO 'warning'
my-app-test LOG: statement: SET time zone 'UTC'
@jeremywadsack
jeremywadsack / move_origin.sh
Last active August 29, 2015 14:05
Change git remote after renaming origin organization at GitHub
# A one-line script to change the origin organization name.
#
# After renaming our organization at GitHub, I had 25 repos I needed to update locally.
# This script finds the current "origin", removes it and replaces it with a new one
# with the organization changed.
#
# Just change OLD_ORG and NEW_ORG below to the old and new organization names and run
# this in each repository.
f=`git remote -v | grep '^origin' | cut -c 8- | cut -d' ' -f 1 | uniq`; git remote remove origin; git remote add origin ${f/OLD_ORG/NEW_ORG}