Skip to content

Instantly share code, notes, and snippets.

@parezcoydigo
parezcoydigo / newtask.py
Created August 10, 2012 00:13
Add task to The Hit List from the Terminal
#! usr/bin/env python
# -*- encoding: utf8 -*-
# Requires Python 2.7, or 2.6 with argparse installed.
# Currently adds task to The Hit List only to the inbox.
import argparse, os
@parezcoydigo
parezcoydigo / gist:4263714
Created December 12, 2012 00:22
Extract text layer from a pdf, clean it up with pandoc.

From Vim's command mode, if I enter this line I get just the text of the pdf, cleaned by pandoc, in a new un-named buffer

:read !pdf2txt <filename> | pandoc -t markdown

Trying to translate this to a line in .vimrc, instead I get a text version of the pdf's headers and metadata, with my new text appended into it.

au *.pdf read !pdf2txt % | pandoc -t markdown

@parezcoydigo
parezcoydigo / countdown.py
Created June 15, 2013 05:33
Simple python countdown clock using sys.stdout
import datetime, sys, time
while secs >= 0:
sys.stdout.write("\r%s" % str(datetime.timedelta(seconds=secs)))
sys.stdout.flush()
secs -= 1
time.sleep(1)
@parezcoydigo
parezcoydigo / todo.scpt
Created February 7, 2014 22:51
Applescript to add email to todo.sh from Mail.app. If you use the `nav` plugin, you can open the email in Mail.app with `todo.sh nav ITEM#` from the cli.
tell application "Mail"
set theSelection to selection
set theMessage to first item of theSelection
set theURL to "message://%3C" & message id of theMessage & "%3E"
set theTitle to subject of theMessage
end tell
set theTitle to do shell script "echo " & quoted form of theTitle & " | sed 's/'\\''//g'"
do shell script "/usr/local/bin/todo.sh a follow up on " & theTitle & ": " & theURL
This file has been truncated, but you can view the full file.
%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/
%% Created for Chad Black at 2014-11-22 08:54:01 -0500
%% Saved with string encoding Unicode (UTF-8)
#! /usr/bin/env python
import git
from time import localtime, strftime
from subprocess import call
crime = git.Repo("/Users/chadblack/Projects/crime")
call(["jrnl",strftime("%H:%M", localtime(crime.head.commit.committed_date))+":",crime.head.commit.message,"@"+crime.description])