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 / TextMate and Mavericks
Created October 28, 2013 20:06
A note from Allan
Dear Sir/Madam,
Forgive me for this unsolicited (one time) service announcement.
I am writing because you have a TextMate license. If you wish to update to OS X 10.9 (Mavericks) and are still using TextMate 1.x then you should be aware that some bundle items will fail due to ruby 2.0 now being the default.
Our recommended fix is to upgrade to TextMate 2.0, which is a free¹ update and can be downloaded from https://macromates.com/download — the reason we still label it alpha is mainly because the manual is incomplete.
The preliminary manual is at http://manual.textmate.org/ and we have a dozen or so blog posts about 2.0 features at https://macromates.com/blog/categories/textmate-2/ but you can also email the mailing list or contact support with any questions, see https://macromates.com/contact.
@ttscoff
ttscoff / customreader-lopash.css
Created October 29, 2013 14:04
Lopash style for CustomReader II Safari Extension
@font-face {
font-family: 'Quattrocento';
font-style: normal;
font-weight: 400;
src: url("data:font/ttf;base64,AAEAAAAQAQAABAAARkZUTWCC9MgAAnHsAAAAHE9TLzJtiUIsAAABiAAAAGBjbWFwqzmq7QAABUQAAAHSY3Z0IAusAkAAAA68AAAAMGZwZ21Bef+XAAAHGAAAB0lnYXNwAAAAEAACceQAAAAIZ2x5Zrg1RrEAABCcAAGoIGhlYWT6jHmFAAABDAAAADZoaGVhB5ED7QAAAUQAAAAkaG10eKtfHrYAAAHoAAADXGtlcm5QLGBkAAG4vAAAqiJsb2NhzGU3ggAADuwAAAGwbWF4cAHjBe4AAAFoAAAAIG5hbWWiv9tgAAJi4AAADQJwb3N0Ooou5wACb+QAAAH/cHJlcK7czoYAAA5kAAAAVgABAAAAAgAApKqGtV8PPPUAHwPoAAAAAMuNGyoAAAAAy40bKv/i/vwEXANQAAAACAACAAAAAAAAAAEAAANQ/vwAAARI/+L/0QRcAAEAAAAAAAAAAAAAAAAAAADXAAEAAADXAK4ABQAAAAAAAgAoADMAPAAAAKIFCwAAAAAAAwH/AZAABQAAArwCigAAAIwCvAKKAAAB3AAyAPoAAAICBQIDAAAABASAAAC/QAAASwAAAAAAAAAAUFlSUwBAAA0iFQNQ/vwAAANQAQQAAAABAAAAAACBApkAAAAgAAED6AAAAAAAAAD9AAAAAAAAAPAAAAD2AEwBMgA1Am4AKgIVADEDDwAsAvMANQCsADUBDwAoAQ8ADgG3AEEB7wAyANUAMwHXAEMA2QA+AbIAKAKGADoBYgAqAhgALgIgADYB/AAVAhMANQIgAEMCAAAkAi4AOgIgADEA4wBDAOkAQAGeACwB6ABLAZ4ASAGoAC4C0gA4AqP/7QJLACsCigA2At4AKwI7ACsCEQArAsQANgL4ACsBTQArAT4AEQKQA
@ttscoff
ttscoff / lazyfootnotes.rb
Created October 29, 2013 17:32
Lazy footnotes for Markdown, based on TidBits lazy link style
#!/usr/bin/env ruby
# encoding: utf-8
=begin
http://marked2app.com
Marked 2 preprocessor - "Lazy" footnotes.
Allows use of `[^]` or `†` footnote references
where the next [^]: or †: note defines the text of the footnote.
@ttscoff
ttscoff / voicesms.rb
Last active December 27, 2015 00:39
Google voice SMS from command line. I've lost track of versions...
#!/usr/bin/env ruby -Ku
require 'net/http'
require 'net/https'
require 'open-uri'
require 'cgi'
require 'optparse'
ACCOUNT = 'USERNAME' # Set to Google Voice account email for default account
PASSWORD = 'PASSWORD' # Set to Google Voice account password for default account
@ttscoff
ttscoff / tagfiler.rb
Last active March 22, 2025 09:34
Moves files to folders based on special tags in OS X Mavericks
#!/usr/bin/env ruby
# encoding: utf-8
# tag primary folders =Tagname
# target them with #Tagname
# tag subfolders with @nickname
# target them with :nickname
# if no tagged folder exists but there's a matching folder name, that's used
# otherwise it will create folders based on :tags
# :tags can be strung together :bt:Drafts:testing for nesting
# Only one #Tag and one :path should exist in a file's tags
@ttscoff
ttscoff / ifttt-pocket_to_nvalt.rb
Created November 1, 2013 12:05
A Hazel script for converting IFTTT-saved Pocket favorites to nvALT notes
#!/usr/bin/env ruby
# Works with IFTTT recipe https://ifttt.com/recipes/125999
#
# Set Hazel to watch the folder you specify in the recipe.
# Make sure nvALT is set to store its notes as individual files.
# Edit the $target_folder variable below to point to your nvALT
# ntoes folder.
require 'date'
require 'open-uri'
require 'net/http'
@ttscoff
ttscoff / app-alias-completion.sh
Created November 2, 2013 00:37
Command-specific Bash filename completions for application aliases
## Applications
# alias acorn="open -a Acorn"
# alias alpha="open -a ImageAlpha"
# alias tp="open -a TaskPaper"
# alias byword="open -a Byword"
# alias xc="open -a Xcode"
#
## subp is a custom function for finding Sublime projects
function _complete_app_alias()
@ttscoff
ttscoff / oft.sh
Created November 2, 2013 16:28
Open File Type script. Fuzzy matches extension fragment to open matching files.
oft() {
local target fnd app all
target="."
fnd=''
if [[ $# == 0 ]]; then
echo -n "Enter an ext or partial ext: "
read ext
else
[[ "$1" =~ -[h\?] ]] && echo "Usage: oft [-a \"app name\"] [path (fragments)] file extension (fragment)" && return
while [[ $# -gt 1 ]]; do
@ttscoff
ttscoff / barchart.rb
Last active February 20, 2025 09:49
Command line bar chart from JSON data (for GeekTool, et al)
#!/usr/bin/env ruby
# encoding: utf-8
# Brett Terpstra 2013, WTF license <http://www.wtfpl.net/txt/copying/>
# Outputs a vertical bar chart from date-based JSON data
# Requires the JSON rubygem: `[sudo] gem install json`
require 'date'
require 'open-uri'
require 'rubygems'
require 'json'
@ttscoff
ttscoff / wakeup.sh
Created November 12, 2013 21:30
Wake remote Mac on local network
#!/bin/bash
if [[ $1 =~ ((mb)?air|pibble) ]]; then
target="pibble.local"
else
target="macpro.local"
fi
ping -c 1 $target &> /dev/null