Skip to content

Instantly share code, notes, and snippets.

Chad Black parezcoydigo

Block or report user

Report or block parezcoydigo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View post-commit jnrl
#! /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])
View default.bib
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)
@parezcoydigo
parezcoydigo / todo.scpt
Created Feb 7, 2014
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.
View todo.scpt
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
@parezcoydigo
parezcoydigo / countdown.py
Created Jun 15, 2013
Simple python countdown clock using sys.stdout
View countdown.py
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 / gist:4263714
Created Dec 12, 2012
Extract text layer from a pdf, clean it up with pandoc.
View gist:4263714

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 / newtask.py
Created Aug 10, 2012
Add task to The Hit List from the Terminal
View newtask.py
#! 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
You can’t perform that action at this time.