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 / planter.rb
Created September 22, 2012 17:57
Create directory trees from indented text input
#!/usr/bin/ruby
=begin
Planter v1.3
Brett Terpstra 2013
ruby script to create a directory structure from indented data.
Three ways to use it:
- Pipe indented (tabs or 2 spaces) text to the script
- e.g. `cat "mytemplate" | planter.rb
- Create template.tpl files in ~/.planter and call them by their base name
@ttscoff
ttscoff / allpinboard.rb
Created September 24, 2012 00:09
Grab all Pinboard.in bookmarks for your account, create a bookmark file for Launchbar indexing
#!/usr/bin/ruby
=begin
This script is designed to generate a simple html file with _all_ of your Pinboard.in bookmarks
The HTML file can be added to Launchbar's index as a custom bookmark file and you can search
your entire Pinboard.in collection instantly from Launchbar (by title only). It includes
any applied tags as part of the title to aid in searching.
This does no checking for deltas, it just grabs the whole bunch and overwrites the html file
every time. Don't run it too frequently.
@ttscoff
ttscoff / luckylink.sh
Created September 26, 2012 11:56
Google API Search from STDIN
@ttscoff
ttscoff / tabs2md.rb
Created September 26, 2012 19:48
Convert indented text lists to Markdown outlines
#!/usr/bin/env ruby
# tabs2md
# Brett Terpstra 2012
#
# Convert indented text to Markdown
#
# Great for apps that can copy out indented outlines but not OPML
# For basic outlines (mind maps) to Markdown, faster than OPML
#
# Indents can be tabs or 4 spaces
@ttscoff
ttscoff / Mindjet2nvALT.applescript
Created September 28, 2012 20:10
Creates nvALT notes from topics in a MindManager mind map, with links to open them from the map.
(*
mindjet2nvalt
Goes through selected nodes in MindJet Manager and creates
nvALT notes for them, adding a rocket icon to each node which
will locate the note when clicked. If the node has a note
attached, it is used as the content of the nvALT note.
Copyright 2012 Brett Terpstra
License is granted to use and modify for personal use
@ttscoff
ttscoff / nvAIR.rb
Created September 29, 2012 17:43
If you've ever wondered whether I have psychological issues, see what happened to this script before I even finished it.
#!/usr/bin/env ruby
# encoding: utf-8
# nvAir: a First Class way to use nvALT/Notational Velocity with the worst documentation ever!
# Built by: Brett Terpstra, <http://brettterpstra.com>
# Destination: WikiLinks and [[wiki links]] to nvALT notes from anywhere on your system.
# This script is at your Service. (You can make it into a System Service with Automator, I mean).
#
# Security line is short today! Please have a photo id in hand. |
# I just need to see your ticket and the folder where you store your note files. o_________(_)________o
$notes_path = '~/Dropbox/nvALT2.2/' # o^o X \_/ X o^o
@ttscoff
ttscoff / PressReleaseBoilerplate.md
Created September 30, 2012 01:24
Simplistic press release boilerplate for apps
FOR IMMEDIATE RELEASE

## AppName vX.X does something interesting

AppName vX.X is on the App Store now, and features the following very interesting feature. This is a summary, so I'm focusing on the lead. Just something to make me want to read the rest. Done.

City, State/Country - [Company/Developer] has released AppName vX.X, available in the Mac App Store. AppName is/does [broad, general strokes]. [A few more specific points about who it's for and why it's of benefit to them].

New features!
@ttscoff
ttscoff / grablinks.js
Created September 30, 2012 19:42
Bookmarklet to send all links within clicked div/table to Pinboard
@ttscoff
ttscoff / imgtag.rb
Created October 9, 2012 17:45
Create image tag using sips
#!/usr/bin/ruby
img = ARGV[0]
width = %x{sips -g pixelWidth #{img}|tail -n 1}.gsub(/pixelWidth: /,'').strip
height = %x{sips -g pixelHeight #{img}|tail -n 1}.gsub(/pixelHeight: /,'').strip
output = %Q{<img src="#{File.basename(img)}" style="width:#{width}px;height:#{height}px">}
print output
@ttscoff
ttscoff / rtftomarkdown.rb
Created October 9, 2012 21:05
Convert RTF/DOC files to Markdown via Textutil
#!/usr/bin/ruby
=begin
Usage: rtftomarkdown.rb FILENAME.rtf
Uses textutil, available on Mac only (installed by default)
Outputs to STDOUT
Notes:
Links are replaced with Markdown references (duplicate links combined).