Skip to content

Instantly share code, notes, and snippets.

View dsanson's full-sized avatar

David Sanson dsanson

View GitHub Profile
@dsanson
dsanson / gist:9289a3f15c25b7ba82ed
Created December 23, 2014 18:37
How Can I Craft This Again Chords
C G Am F
You get online and the world forms 'round you
C G Dm F
It's been a while, haven't played since point 2!
C G Am F
You break a smile, 'cause you've almost forgot to mine
C G Dm F C G
It's just been such a long time! And every time you're denied
Am F C G
#!/bin/bash
#
# Get A Phil Papers Item (gappi); version 0.3
# by Kevin C. Klement (klement@philos.umass.edu)
# Feel free to email Kevin with suggestions or questions
# License: GPLv3
#
# get the name of the script
SCRIPTNAME="$(basename "$0")"
@dsanson
dsanson / pdfocr.sh
Created September 15, 2010 15:13
pdfocr.sh: ocr scan pdfs to make them searchable
#!/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" && \
@dsanson
dsanson / bibkey
Created September 15, 2010 15:14
extract bibtex keys
#!/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
@dsanson
dsanson / backuptosdhc.sh
Created September 15, 2010 15:17
backup to sdhc
#!/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="/"
@dsanson
dsanson / pd
Created March 6, 2011 20:24
pd: a wrapper around pandoc that allows setting up some default options
#!/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.
@dsanson
dsanson / export_chrome_history.sh
Created March 10, 2011 20:09
dump chrome's history to a text file for use with quicksilver.app
#!/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
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
@dsanson
dsanson / extract_pandoc_bib.sh
Created August 29, 2011 03:33
produce a bibtex file with only the pubs referred to by a pandoc file
#!/bin/sh
# Generate a bibtex file just containing those publications cited in
# a given pandoc document. To use
#
# extract_pandoc_bib.sh myfile.markdown
#
# this will generate `myfile.bib`.
bib="$HOME/.pandoc/default.bib"

Here is a header

Turns out it is not just headers that aren't getting treated right. Here is some text in italics. And some bold text.

And here is another header

And another header

And another header