This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Create an indented, structured CSS skeleton from valid XHTML markup | |
require 'rubygems' | |
require 'hpricot' | |
input = STDIN.read | |
def recurse_el(el,indent,parentEl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env osascript | |
-- For more info, see http://brettterpstra.com | |
-- Surf Saver 1.0 | |
-- Saves tabs from Safari window to a dated page in VoodooPad, with a timestamp for the link group. | |
-- format of output is templatable below, defaults to markdown list. | |
-- | |
-- Script by Brett Terpstra | |
-- http://brettterpstra.com | |
-- built off of the amazing Scratchpad scripts by Ian Beck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -rjcode -Ku | |
# TextMate command to get the first url | |
# from a Songza.fm search for the selected text. | |
# Input: Selected Text or Word | |
# Output: Show as Tool Tip | |
require ENV['TM_SUPPORT_PATH'] + '/lib/escape' | |
require 'open-uri' | |
require 'rubygems' | |
require 'hpricot' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -rjcode -Ku | |
# TextMate Command "Songza Link" | |
# Scrapes the results of a Songza.fm search for | |
# the selected text, offers a popup menu and | |
# inserts a snippet of the selected link and title | |
# tab-stopped for easy removal of the title. | |
# Requires Rubygems and Hpricot | |
# Input: Selected Text or Word | |
# Output: Insert as Snippet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -rjcode -Ku | |
# From a TextMate command, but without TextMate-specific environment variables. | |
# Still works in TextMate, but makes a good Snow Leopard service as well. | |
# requires that MultiMarkdown be installed in ~/Library/Application Support/MultiMarkdown | |
# That, or edit the script to point to yours :) | |
input = STDIN.read | |
contents = '' | |
tags = '' | |
title = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -rjcode -Ku | |
require 'rss/2.0' | |
require 'open-uri' | |
require 'time' | |
class RSSFetcher | |
RED = "\033[1;31m" | |
GREEN = "\033[32m" | |
YELLOW = "\033[33m" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Drag command set to handle: jpg,png,gif | |
# scoped to: text.html.basic source.css.embedded.html, source.css meta.scope.property-list.css | |
openssl base64 -in "$TM_DROPPED_FILE" | awk -v ext="${TM_DROPPED_FILE#*.}" '{ str1=str1 $0 }END{ print "background:url(data:image/"ext";base64,"str1");" }' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Usage: tp2md.rb filename.taskpaper > output.md | |
# Updated 2025-03-19 | |
# - Fix block quote indentation | |
# - use GFM-style - [ ] markers | |
# - convert @tags to #tags | |
# - <self-link> bare urls | |
# - Accept input piped on STDIN | |
if $stdin.stat.size.positive? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This function performs app completion (open -a) based on known applications | |
# Originally by Kim Holburn http://www.holburn.net/ | |
# Modified by Brett Terpstra because it wasn't working on 10.6. | |
# Added case insensitivity and LC_ALL='C' because unicode chars were breaking it. | |
# Then I went and modified the completion command | |
# even though I have little idea what I'm doing. | |
# | |
# also add 'o' to complete because I alias o to "open -a" |
OlderNewer