Skip to content

Instantly share code, notes, and snippets.

View kristianfreeman's full-sized avatar
🙃

Kristian Freeman kristianfreeman

🙃
View GitHub Profile
@kristianfreeman
kristianfreeman / dayonecli-install
Created January 31, 2012 02:54
installing Day One CLI. Keep forgetting for some reason.
sudo ln -s /Applications/Day\ One.app/Contents/MacOS/dayone /usr/bin
@kristianfreeman
kristianfreeman / gitlogtoday.sh
Created January 31, 2012 02:54 — forked from ttscoff/gitlogtoday.sh
Git log for the last day, formatted for journal insertion
git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short --since="`date -v-1d '+%m/%d/%y'`"
Prettier:
git log --pretty=format:"%ad | [`pwd`]%n- %s%d" --graph --date=short --since="`date -v-1d '+%m/%d/%y'`"
Day One:
git log --pretty=format:"%ad | [`pwd`]%n- %s%d" --graph --date=short --since="`date -v-1d '+%m/%d/%y'`" | dayone new
@kristianfreeman
kristianfreeman / vim-ada-b-and-c
Created February 23, 2012 20:27
Ada build/compile in Vim
set makeprg=/usr/local/gnat/bin/gnatmake
@kristianfreeman
kristianfreeman / freeman_smith_hw3a.adb
Created February 25, 2012 00:16
homework assignment #3a CS141
-- Homework 3a: The "Riffle Shuffle"
-- Max Smith and Kristian Freeman
-- TA: Caleb Nelson
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Text_IO; use Ada.Text_IO;
PROCEDURE hw3a is
maxDeck : CONSTANT positive := 52; -- Card decks don't get any larger...
SUBTYPE deckRange is positive RANGE 1..maxDeck;
@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),
@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 / 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 / gist:3203651
Created July 30, 2012 02:45
CSS for drang
html {
zoom: 1.5;
}
@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 / 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__))