Skip to content

Instantly share code, notes, and snippets.

View gvvaughan's full-sized avatar

Gary V. Vaughan gvvaughan

View GitHub Profile
@gvvaughan
gvvaughan / Tag as Done.scpt
Created May 29, 2010 10:41
TaskPaper TagAsDone.scpt
-- true if you want @done(YYYY-MM-DD), false if you want @done
property doneDates : true
-- save this script as an application to ~/Library/Application Support/TaskPaper/Scripts
-- and make (or copy from the system sounds) a "task done.aiff" file in the subdirectory:
-- "Tag as Done.app/Contents/Resources/"
set donefile to (path to me as string) & "Contents:Resources:task done.aiff" as alias
set donesound to quoted form of (POSIX path of (donefile as alias))
on getShortDate()
@gvvaughan
gvvaughan / Clock In|Out.scpt
Created June 1, 2010 12:49
TaskPaper Clock In|Out.scpt
property clockString : "CLOCK: "
-- return a timestamp string from a date object
on dateToTimestamp(theDate)
set {weekday:w, day:d, year:y, time:t} to theDate
set theTime to time string of theDate
-- Calculate the month number.
copy theDate to b
set b's month to January
set m to (b - 2500000 - theDate) div -2500000
@gvvaughan
gvvaughan / Submit Timesheet.scpt
Created October 7, 2010 04:08
TaskPaper Submit Timesheet.scpt
(* script version: 2010-10-08
Changes: 2010-10-09
- work in all locales, by coercing date strings to US or EU internal formats as necessary
*)
property ratePerHour : 51
property roundMinutes : 15
property theBoss : "Name of your Boss"
@gvvaughan
gvvaughan / MD Title Extract.py
Created January 22, 2013 06:13
MD Title Extract
import re
g = re.search ('\[[^\]]*\]\(.*"([^"]*)"\)','[foo](bar.com "Title")')
print (g.group(1))
@gvvaughan
gvvaughan / lua-5.2-homebrew.diff
Last active December 18, 2015 19:19
Patch upstream lua-5.2.2 for building on Mac OS X by Homebrew.
## Patch upstream lua-5.2.2 for building on Mac OS X by Homebrew.
1. An extension of my earlier in-formula shared library compilation patch for earlier
releases.
2. Install binaries, headers, manual pages and library with 5.2 suffixes to enable
parallel installation with other versions of lua.
diff --git a/Makefile b/Makefile
index bd9515f..81daea5 100644
@gvvaughan
gvvaughan / lua-5.1-homebrew.diff
Last active December 18, 2015 19:19
Patch upstream lua-5.1.5 for building on Mac OS X by Homebrew.
## Patch upstream lua-5.1.5 for building on Mac OS X by Homebrew.
1. An extension of my earlier in-formula shared library compilation patch for earlier
releases.
2. Install binaries, headers, manual pages and library with 5.1 suffixes to enable
parallel installation with other versions of lua.
3. At the moment, lua 5.2.2 is the latest release, so we don't symlink the suffixed
versions to the usual locations of the binaries and man pages for 5.1.5 which must
@gvvaughan
gvvaughan / luarocks-2.0-homebrew.diff
Last active December 19, 2015 00:08
Patch upstream luarocks-2.0.13 for parallel Lua interpreter installations per http://lua-users.org/wiki/LuaRocksConfig
diff --git a/Makefile b/Makefile
index 67c3ce0..2d149c7 100644
--- a/Makefile
+++ b/Makefile
@@ -81,8 +81,13 @@
for f in $(BIN_FILES) ;\
do \
sed "1d" src/bin/$$f > src/bin/$$f.bak ;\
- echo "#!$(LUA_BINDIR)/lua$(LUA_SUFFIX)" > src/bin/$$f ;\
- echo "package.path = [[$(LUADIR)/?.lua;$(LUADIR)/?/init.lua;]]..package.path" >> src/bin/$$f ;\
@gvvaughan
gvvaughan / mail
Created June 27, 2013 11:57
Wrap mutt in a BSD compatible command line API. Allows you to send emails with attachments from the shell with, eg: `cat body | mail -s 'subject' -a attached-file-path [email protected]`
#! /bin/sh
: ${MUTT=mutt}
: ${SED=sed}
func_esc ()
{
echo "$*" | $SED "s|'|'\\\\''|"
}
@gvvaughan
gvvaughan / gnosis.zsh-theme
Created August 23, 2015 13:16
A colorful multi-line oh-my-zsh theme with git status etc.
# Some colors
# -----------
# Expand these right away, to minimise cycles spent expanding every prompt!
# You can override these before loading the theme.
: ${GNOSIS_C1="%{$reset_color$fg[blue]%}"}
: ${GNOSIS_C2="%{$reset_color$fg_bold[green]%}"}
: ${GNOSIS_C3="%{$reset_color$fg[cyan]%}"}
: ${GNOSIS_ACCENT1="%{$reset_color$fg[yellow]%}"}
: ${GNOSIS_ACCENT2="%{$reset_color$fg_bold[white]%}"}
: ${GNOSIS_STANDOUT="%{$fg_bold[red]%}"}