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 / Remind.applescript
Created November 22, 2012 03:24
Simple relative-date LaunchBar -> Reminder.app
-------------------------
-- Display Alert 1.2 for LaunchBar 5
-- this script displays a large typed message after a given delay time
--
-- originally written by ludwigschubert http://forums.obdev.at/viewtopic.php?f=24&t=615
-- modified by Zettt (http://www.zettt.de) at 2009-05-04
-- thanks to ptujec for providing additional information about changed AppleScript terms
--
-- Usage: Call LaunchBar, Hit Space, Input your message and provied your delay time at the end in "3s", "1m" or "2d" (without quotes)
-- Example: "This is an example message 2s" (without quotes)
@ttscoff
ttscoff / remind.rb
Created November 22, 2012 05:27
Quick little CLI to make Reminders.app reminders
#!/usr/bin/env ruby
# Quick little CLI to make Reminders.app reminders
# Requires 'amatch' and 'chronic' gems
#
# Pipe text in to create an attached note
# First text in note is the title
# An @ separates title from time, if there's no @, no date is set
# use @\d[hmd] to add time from the current date/time
# use "@tomorrow" or "@wednesday 3pm" to parse natural language
# use ! at the end to set high priority
@ttscoff
ttscoff / private.xml
Created December 8, 2012 19:00
KeyRemap4MacBook XML for hyper key, mix with PCKeyBoardHack to turn Caps Lock key into something useful
<?xml version="1.0"?>
<root>
<item>
<name>F19 to F19</name>
<appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send escape)</appendix>
<identifier>private.f192f19_escape</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L,
@ttscoff
ttscoff / brett.txt
Created December 10, 2012 15:33
Me, text
・・・・・・・・・・・・・・・・・・・・・・・・・・゛、しウウワワー、、゛・・・・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・・・・、ーワウウワワワしウウウサををサし゛・・・・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・・・、しウウウワワワーノしししワワウウワウけけサワ、・・・・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・・・。ワワノ。、ーしししノしワウしーししワワしノーしけ日けし゛・・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・・、しし、゛、ーノしワしーノ。ししワしノしワワしワノ。、ノサ私日ー・・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・・しウ、・・゛。ワウウワーーノーノしウしノしノワしノー。、、、しけ私ウ・・・・・・・・・・・・・・・・・
・・・・・・・・・・・・・しワ、・・゛、。ーノノー、。。。、ーノーーー、。ー。。。。。、、。ウ私け゛・・・・・・・・・・・・・・・
・・・・・・・・・・・・しワ、゛゛゛゛゛゛゛゛゛゛・゛、、、、、、、。、、。。。。。。。。。ーウ日サ・・・・・・・・・・・・・・・
・・・・・・・・・・・。ワ、゛、、、、゛゛゛゛・゛・゛゛゛、、、、、。、。。ーーーーーーーー。ーけ日ワ・・・・・・・・・・・・・・
・・・・・・・・・・、しノ゛、、、、、゛゛゛゛゛゛゛゛゛゛、、、、、。。。ーーノノノノノノノー。ウ私私ワ・・・・・・・・・・・・・
11111
11110
11110
11110
11110
11110111111111
1111111111111111
1111111
111110
111100
@ttscoff
ttscoff / recoll-mountain-lion.md
Created December 11, 2012 15:25
Installing Recoll on Mountain Lion (personal notes)

Installing Recoll on Mountain Lion

 brew install xapian qt

Edit file:///usr/local/Cellar/qt/4.8.3/mkspecs/common/g++-macx.conf

QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=10.7
QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=10.7

configure, make, sudo make install

@ttscoff
ttscoff / jekyllpre.rb
Created January 4, 2013 12:35
Example Marked custom processor for previewing Jekyll posts
#!/usr/bin/ruby
# For use with Marked <http://markedapp.com> and Jekyll _posts
# turns
# {% img alignright /images/heythere.jpg 100 100 "Hey there" "hi" %}
# into
# <img src="../images/heythere.jpg" alt="Hey there" class="alignright" title="hi" />
#
# replaces alignleft and alignright classes with appropriate style attribute
#
# Processes final output with /usr/bin/kramdown (install kramdown as system gem: `sudo gem install kramdown`)
@ttscoff
ttscoff / jekyllpre.rb
Last active September 7, 2019 16:02
Marked Custom Processor for Jekyll/Octopress previews with img/gist Liquid tags
#!/usr/bin/ruby
# encoding: utf-8
# Version 1
#
# Example custom processor for use with Marked <http://markedapp.com> and Jekyll _posts
# It's geared toward my personal set of plugins and tags, but you'll get the idea.
# It turns
# {% img alignright /images/heythere.jpg 100 100 "Hey there" "hi" %}
# into
# <img src="../images/heythere.jpg" alt="Hey there" class="alignright" title="hi" />
@ttscoff
ttscoff / textexpander_gen.rb
Last active February 20, 2025 10:02
Mass generate TextExpander snippets from a CSV file
#!/usr/bin/ruby
require 'csv'
require 'erb'
require 'cgi'
if ARGV.length == 2
input_csv = ARGV[0]
output_te = ARGV[1]
unless output_te =~ /\.textexpander$/
puts "Second argument must have a '.textexpander' extension."
@ttscoff
ttscoff / syncnotesapp.applescript
Created January 8, 2013 18:13
Rough script to sync Mac Notes.app notes to nvALT
-- rough script to sync Mac Notes.app notes to nvALT
-- will overwrite existing files with the same title
-- which also makes it able to update notes with changes
-- does _not_ delete notes not found in Notes.app
property notes_folder : "/Volumes/Raptor/Users/ttscoff/Dropbox/nvALT2.2/"
tell application "Notes"
repeat with _note in notes
set output_file to name of _note & ".md"
set output_content to (do shell script "echo " & quoted form of (body of _note as string) & "|~/scripts/html2text > \"" & notes_folder & output_file & "\"")