Skip to content

Instantly share code, notes, and snippets.

View ttscoff's full-sized avatar
💭
Breathing

Brett Terpstra ttscoff

💭
Breathing
View GitHub Profile
@ttscoff
ttscoff / massnippet.txt
Created March 18, 2012 20:52
Auto-redeem link for Mac App Store promo codes
macappstores://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/redeemLandingPage?code=XXXXXXXXX
@ttscoff
ttscoff / keybindings.html
Created April 22, 2012 17:13
Updated Cheaters cheatsheet for Brett's Keybindings.dict
<table>
<caption id="generalcommands"> General Commands </caption>
<colgroup>
<col style="text-align:center;"/>
<col style="text-align:left;"/>
</colgroup>
<thead>
<tr>
<th style="text-align:center;" colspan="2">General Commands</th>
@ttscoff
ttscoff / commenttest.md
Created May 4, 2012 13:13
Persistent Marked styles in HTML comments

Testing styles in comments

Marked will find metadata such as "Marked Style:" anywhere in the document as long as it's the first thing on a line. This means you can surround the line with HTML comments and still have persistent styles without the metadata showing up in other systems that don't process it.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

@ttscoff
ttscoff / CSSCmdEnter.sublime-keymap
Created May 17, 2012 09:44
TextMate CSS {...} on Cmd-Enter for Sublime Text 2
[
{ "keys": ["super+enter"], "command": "insert_snippet", "args": {"contents": " {\n $0\n}"}, "context":
[
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }
]
}
]
@ttscoff
ttscoff / copy_scope.py
Created May 17, 2012 21:55
Copy Scope plugin for Sublime Text 2
import sublime, sublime_plugin
class CopyScopeCommand(sublime_plugin.TextCommand):
def run(self, edit):
sublime.set_clipboard(self.view.scope_name(self.view.sel()[0].begin()))
sublime.status_message("Copied scope")
def is_enabled(self):
return self.view.sel()
@ttscoff
ttscoff / podcastnames.md
Created June 5, 2012 00:52
Brainstorming Names

Title brainstorming

A collection of random ideas in random order. Some mine, some from the good folks on Twitter, some mine but inspired by Twitter folk.

  • Command Control Escape
  • Look, I made you this/something
  • ALT
  • <alt.nerd>
  • Power Hour
  • Terminal Nerdery
@ttscoff
ttscoff / complete_domain.sh
Created June 16, 2012 09:51
defaults domain completion for Bash on OS X
## Bash completion for `defaults` domains
## e.g. `defaults read com.apple[TAB]`
_complete_domain ()
{
local cur
local LC_ALL='C'
cur=${COMP_WORDS[COMP_CWORD]}
cur=${cur//\./\\\.} # escape dots for grep
local IFS="
@ttscoff
ttscoff / tu2ifttt-bt.py
Created July 5, 2012 04:52
Modified version of Dr. Drang's ThinkUp db -> text file script. Adds Markdown formatting and t.co expansion.
#!/usr/bin/python
import csv
import os
from datetime import datetime
import sys
import re
import urllib2
expand_tco_links = False
@ttscoff
ttscoff / ifttt-tweets2md.py
Created July 5, 2012 12:06
Converts a ThinkUp CSV export to monthly archive files with Markdown formatting
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
This script parses a text file with archived tweets and sorts them into archive files based on month
Original script by [Ian Beck](http://beckism.com/2012/07/archiving-tweets/) 2012
This iteration by [Brett Terpstra](http://brettterpstra.com) 2012
Designed to operate via Hazel or other file watcher. Reads a Dropbox file
@ttscoff
ttscoff / growlnotify.rb
Created August 1, 2012 11:18
Seamless drop-in to turn existing growlnotify calls into Mountain Lion Notifications
#!/usr/bin/env ruby
# encoding: utf-8
# == Synopsis
# Requires the terminal-notifier gem ([sudo] gem install terminal-notifier)
# growlnotify wrapper to turn Growl alerts into Mountain Lion notifications
# Uses growlnotify option syntax to keep your old scripts working with the new shiny.
#
# If you use Growl via growlnotify in your shell scripting, this script
# will replace Growl's alerts with Mountain Lion notifications.