Skip to content

Instantly share code, notes, and snippets.

View dreki's full-sized avatar

Sean Gilbertson dreki

  • Understood
  • MN and NY
View GitHub Profile
@dreki
dreki / safari-tabs-with-favicons.applescript
Created April 15, 2014 13:38
Update to "Back up Safari Tabs to Evernote" Applescript by twitter.com/ttscoff that adds favicons.
-- SET METADATA
property Title : "Title: URL List from Safari Tabs"
property Notebook : "Notebook: Reading List"
property Tags : "Tags: linklist, temp"
-- DATE STAMP
set dateStamp to do shell script "date '+%Y-%m-%d, %I:%M %p'"
-- PREPARE THE LIST
set urlList to {}
@dreki
dreki / flash_db.rake
Created August 8, 2012 20:21
Easily flash your local Rails database with data from your Heroku environment
# Flash your local Rails database with data from your Heroku environment.
# Much faster than heroku db:pull.
#
# Notes:
# - Requires that you use postgres locally
# - Requires that pg_restore is available
# - Requires initialized Heroku setup for the given project
# - Requires that the pgbackups addon be installed for the given Heroku app
require "open-uri"
@dreki
dreki / dst_helper.rb
Created June 20, 2012 20:12
Fix for unexpected :time column behavior in Rails 3.2
module DstHelper
# Have a Time inherit DST status from a Date.
def inherit_dst date, time
time = time.change(:year => date.year, :month => date.mon, :day => date.day)
end
def self.included includer
# Mix in class methods.
includer.extend ClassMethods
end