Skip to content

Instantly share code, notes, and snippets.

@kbro237
kbro237 / council report.taskpaper
Created March 15, 2018 16:26
Script and template example I use to go from a taskpaper template to to a project I can paste directly into OmniFocus
- wrote ${month} council report @parallel(false) @context(office)
- check Council Planning folder @context(office) @defer(${date_of_meeting} -6d +9h)
- check 'council' context in OmniFocus @context(anywhere) @defer(${date_of_meeting} -6d +9h)
- use cal & OF to write report to council @context(mac) @defer(${date_of_meeting} -6d +9h)
- save report as PDF @context(mac) @defer(${date_of_meeting} -6d +9h)
@kbro237
kbro237 / second-date.py
Created January 2, 2017 13:06
pandoc filter to change the date format of metadata
#!/usr/bin/env python3
"""
Pandoc filter to change the date formatting in metadata from
whatever it is to whatever strftime format you specify. This
allows you to keep your source documents in one format, but
output to another format.
"""
from panflute import run_filter, MetaMap, Str
@kbro237
kbro237 / pretty_date.py
Last active February 19, 2022 18:45
pretty_date.py
# Pythonista for iOS script
from dateutil import parser
from datetime import datetime
import sys, clipboard
def make_pretty(input_date):
dt = parser.parse(input_date)
pretty_date = dt.strftime('%B %d, %Y')
@kbro237
kbro237 / AddContactNote.py
Created June 28, 2014 11:58
AddContactNote.py
# Quickly add a note with a Cobook styled delimeter to a contact based on its abid (Apple ID) which can be chosen, for example, by Launch Center Pro. Try this url:
# pythonista://{{AddContactNote}}?action=run&argv=[contact-abid]&argv=[prompt:Note to add...]
import contacts
import sys
# get the apple id and new note for the contact from the url arguments
abid = int(sys.argv[1])
newnote = sys.argv[2]
@kbro237
kbro237 / kwblt-quix.txt
Created February 8, 2010 14:45
Keith's Quix commands
> Keith Walbolt's Custom Quix Commands
> Based on Merlin Mann's Custom Quix Commands (http://gist.github.com/290059)
> kwblt-quix.txt
> http://quixapp.com
> 2010-10-12
e javascript:popw='';Q='';x=document;y=window;if(x.selection)%20{Q=x.selection.createRange().text;}%20else%20if%20(y.getSelection)%20{Q=y.getSelection();}%20else%20if%20(x.getSelection)%20{Q=x.getSelection();}popw%20=%20y.open('https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=&su='%20+%20escape(document.title)%20+%20'&body='%20+%20escape(Q)%20+%20escape('\n')%20+%20escape(location.href)%20+%20'&zx=RANDOMCRAP&shva=1&disablechatbrowsercheck=1&ui=1','gmailForm','scrollbars=yes,width=680,height=510,top=175,left=75,status=no,resizable=yes');if%20(!document.all)%20T%20=%20setTimeout('popw.focus()',50);void(0); gmail this page
cal javascript:var%20s;if(window.getSelection){s=window.getSelection();}else{s=document.selection.createRange().text;}var%20t=prompt('Please%20enter%20a%20description%20for%20the%20event',s);if(t){void(w