Skip to content

Instantly share code, notes, and snippets.

View kristianfreeman's full-sized avatar
🙃

Kristian Freeman kristianfreeman

🙃
View GitHub Profile
@kristianfreeman
kristianfreeman / gistsnip.md
Created August 13, 2012 20:15
TE snippet for iTunes Now Playing Output

A simple TextExpander snippet for pasting a nice-looking version of your "Now Playing" from iTunes. Uses Applescript — if you have a different music player (Spotify, for example), it probably has similar Applescript support.

For example: ♫ "My Favourite Things" - John Coltrane (The Very Best of John Coltrane, 2000)

set the_string to ""

tell application "iTunes"
   if player state is playing then
      set the_string to "\"" & name of current track & "\""

if artist of current track is not "" then

@kristianfreeman
kristianfreeman / dayone-adn.rb
Created August 11, 2012 18:10
Export into my Day One format for App.net posts
require 'json'
require 'date'
json = File.read('appnet.json')
parsed = JSON.parse(json)
f = File.new("dayoneappdotnet.txt", "a")
@kristianfreeman
kristianfreeman / adn.rb
Created August 11, 2012 17:20
App.net backup
# requires "appnet.json" (exported from ADN) in the same folder
require 'json'
require 'date'
json = File.read('appnet.json')
parsed = JSON.parse(json)
f = File.new("appdotnet.txt", "a")
@kristianfreeman
kristianfreeman / slogger fix
Created August 5, 2012 19:54
Fix for @ttscoff's Slogger and Ruby 1.9
#!/usr/bin/ruby
# Fix for Slogger and Ruby 1.9
#
# require 'ftools'
#
require 'fileutils'
curloc = File.expand_path(File.dirname(__FILE__))
@kristianfreeman
kristianfreeman / atv.md
Created August 1, 2012 03:15
ATV Screensavers

The Apple TV has some nice pictures for screensavers, but there's only about ~20 on average for each screensaver set. Luckily, with a jailbroken Apple TV, we can replace them pretty easily.

The screensaver images are located at /System/Library/PrivateFrameworks/AppleTV.framework/Default[Album]Photos. I like SFTP'ing in with Cyberduck.

There are multiple screensaver sets — if you have a set you like the least (maybe "FlowerPhotos"?), replace those.

The files are in a pretty basic format:

01.jpg
02.jpg
@kristianfreeman
kristianfreeman / gist:3203651
Created July 30, 2012 02:45
CSS for drang
html {
zoom: 1.5;
}
@kristianfreeman
kristianfreeman / ads-knt.sh
Created June 4, 2012 21:04
removing ads on Kindle NT (no touch)
# Disable wifi
rm -rf /Volumes/Kindle/system/.assets
echo "Disable WiFi on your Kindle - it will download new ads if you don't."
echo "If you want a more thorough (permanent) method of removing ads, see Yifan Lu's work."
@kristianfreeman
kristianfreeman / utc-timezone-regex.md
Created April 1, 2012 01:36
regexing a utc timezone code

Trying to regex in ruby using this: /UTC\s.\d{4}/

This picks up both

UTC +0000 UTC -0800

The codebase I'm working with uses: /UTC\s\-?\d{4}/

@kristianfreeman
kristianfreeman / itunes.sql
Created March 12, 2012 06:16 — forked from shanemcd/itunes.sql
itunes music library database
/* create tables to store itunes music library data for quick access
- rkumar 2010 July
*/
drop table tracks;
create table tracks (
album_artist VARCHAR(50),
album_rating_computed INTEGER,
album_rating VARCHAR(50),
album VARCHAR(50),
all_items VARCHAR(50),