This file contains 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 script converts RTF text on the OS X clipboard to HTML. | |
osascript -e 'the clipboard as «class RTF »' | \ | |
perl -ne 'print chr foreach unpack("C*",pack("H*",substr($_,11,-3)))' | \ | |
textutil -format rtf -convert html -stdin -stdout | \ | |
ruby -ne '@found=true if $_ =~ /<body>/; next unless @found; puts $_; exit if $_ =~ /<\/body>/' | \ | |
grep -v "<body>" | \ |
This file contains 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 | |
# Convert RTF contents of clipboard to HTML | |
osascript -e 'the clipboard as «class RTF »' | \ | |
perl -ne 'print chr foreach unpack("C*",pack("H*",substr($_,11,-3)))' | \ | |
textutil -format rtf -convert html -stdin -stdout | \ | |
ruby -ne '@found=true if $_ =~ /<body>/; next unless @found; exit if $_ =~ /<\/body>/; puts $_;' | \ | |
grep -v "</body>" | \ | |
pbcopy |
This file contains 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 | |
# Convert RTF contents of clipboard to HTML | |
osascript -e 'the clipboard as «class RTF »' | \ | |
perl -ne 'print chr foreach unpack("C*",pack("H*",substr($_,11,-3)))' | \ | |
textutil -format rtf -convert html -stdin -stdout | \ | |
pandoc -f html -t markdown | \ | |
pbcopy |
This file contains 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 is a shell wrapper around the command line version of | |
# [VelOCRaptor](http://www.velocraptor.com/), an affordable | |
# OCR program for OS X. | |
# | |
if [ $# = 2 ]; then | |
echo "Scanning file..." | |
/Applications/VelOCRaptor.app/Contents/SharedSupport/velocraptor.rb "$1" "$2" && \ |
This file contains 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/ruby | |
## get a sorted list of cite keys that match an array of strings | |
## | |
## Usage: | |
## | |
## $ bibkey citekey1 [citekey2 ...] | |
## $ bibkey path-to-bibtex citekey1 [citekey2 ...] | |
## | |
## if the first argument is a path to a readable file, then the |
This file contains 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 | |
# A script that first checks if an external disk is mounted and | |
# then uses rsync to perform a time machine style backup. | |
# | |
# I need to work on the how the script behaves when the disk is | |
# full. Ideally, it would delete the oldest backup. | |
# | |
original="/" |
This file contains 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 bash | |
# | |
# AUTHOR:: David Sanson | |
# URL: https://gist.github.com/857619 | |
# LICENSE: http://creativecommons.org/licenses/MIT/ | |
# VERSION: 0.2 | |
# | |
# IN PROGRESS: | |
# Support for "profiles". | |
# Removed $defaultopts_markdown2pdf---just use formatopts[pdf] instead. |
This file contains 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 | |
# | |
# export_chrome_history.sh | |
# | |
# A script to dump a list of urls from Google Chrome's History | |
# database on OS X. It should work on any *nix, but you'll need | |
# to edit the values of $input_file and $output_file. | |
# | |
# | |
# Author: David Sanson |
This file contains 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
/* | |
This is my hacked up copy of Marked.app/Contents/Resources/gridless.css | |
Changes: | |
1. Smaller headings | |
2. ~~No scrollbars~~ (I now prefer the Lion default behavior) | |
3. Styling of definition lists ala LaTeX description lists. | |
4. Centering h1.title, h3.author, h4.date (pandoc's title/author/date block). | |
This file contains 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
HOMEBREW_VERSION: 0.8 | |
HEAD: 97b62b8b3f1c8973cf8a2575bfc98706ccbbde39 | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
HOMEBREW_REPOSITORY: /usr/local | |
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew | |
Hardware: dual-core 64-bit penryn | |
OS X: 10.7.1 | |
Kernel Architecture: x86_64 | |
Ruby: 1.8.7-249 |
OlderNewer