Skip to content

Instantly share code, notes, and snippets.

View jkeen's full-sized avatar

Jeff Keen jkeen

View GitHub Profile
@nschum
nschum / README.md
Created September 21, 2014 20:44
OS X Yosemite Messages database merger

OS X Yosemite Messages database merger

Early betas of OS X Yosemite had a bug where the library of old messages wasn't migrated. Instead a new library was created and all old messages were gone.

The bug has been fixed, but if you were affected, you still have two separate libraries. This script merged them for me. Use it at your own risk! You might end up worse than before. Backup everything beforehand. Twice.

This is what your ~/Library/Messages folder will look like if you're affected:

  • chat.db
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@asbjornu
asbjornu / export-address-book.scpt
Created September 10, 2011 12:26
Export all Mac OS X Address Book entries as single vCard files to a chosen folder
property targetfolder : "" as Unicode text
try
set targetfolder to choose folder with prompt "Choose a folder or volume:" as Unicode text
on error
beep
display dialog "Invalid path" buttons "Exit"
return
end try
#!/usr/bin/env ruby
# The script that give you focus!
# Create a text file that contains sites you only want to give yourself
# access to during certain times of day.
# The file will look like this:
# 12 news.ycombinator.com
# 11-13,19-21 twitter.com
#
# In this case, I can visit hacker news only over the lunch hour,