Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ngoffee on github.
  • I am ngoffee (https://keybase.io/ngoffee) on keybase.
  • I have a public key ASCNkLdwhuVMMdaUqblaJeQy-A6HNWKm_X34IHkMdVHY9Ao

To claim this, I am signing this object:

@ngoffee
ngoffee / apple-code-signing-certs.sh
Last active August 29, 2015 14:08
Extract the root certificates on a Mac and find the ones authorized for code signing
#!/bin/bash
# Directory to put results; will rm -f *.pem *.txt */*.pem */*.txt in it
# Code signing certs will be put in "$RESULTS"/code-signing-certs
#
# On my Mac (10.9.5), I see 7 code signing certs, not all of them Apple's.
# I haven't dug in enough to know if these CAs can therefore issue
# code-signing certs that Gatekeeper will accept.
RESULTS=results
@ngoffee
ngoffee / attrdict.py
Created February 5, 2013 19:48
Dict whose items can also be accessed as attributes. This is the trivial implementation suggested by Martin Miller on StackExchange: http://code.activestate.com/recipes/576972-attrdict/ with my own doctests.
class AttrDict(dict):
"""Dict whose items can also be accessed as attributes.
This is the trivial implementation suggested by Martin Miller on
StackExchange: http://code.activestate.com/recipes/576972-attrdict/
>>> ad = AttrDict()
Normal dict access:
>>> ad['foo'] = 3
@ngoffee
ngoffee / goodreads2md.py
Created January 25, 2013 01:13
Convert a Goodreads csv export to headings and itemized lists in Markdown
#!/usr/bin/env python
import csv
import re
import sys
from collections import namedtuple
def oxford_join(seq):
if len(seq) == 1:
return seq
@ngoffee
ngoffee / nv2org.sh
Created November 1, 2012 01:11
Convert a directory of Notational Velocity notes to a single Emacs org-mode file
#!/bin/sh
# Convert a directory of Notational Velocity notes to a single file of
# Emacs org-mode notes. Must be run from within the directory to be
# converted. Each entry in the resulting org file will be a 2nd-level
# entry ("** ...") whose title is derived from the filename and whose
# body contains the file contents. Output is written to stdout. '*' at
# the beginning of a line will be converted to '-' to avoid being
# confused with an org-mode headline.
@ngoffee
ngoffee / rtm2evernote.py
Created October 27, 2012 16:19
Convert Remember the Milk tasks to Evernote notes
#!/usr/bin/env python
# rtm2evernote.py
#
# Convert Remember the Milk tasks to Evernote notes, using approximately
# the the Evernote setup recommended in "The Secret Weapon":
#
# http://www.thesecretweapon.org/the-secret-weapon-manifesto/setting-up-the-secret-weapon
#
# requires Python >= 2.7 (for ElementTree.iter())
@ngoffee
ngoffee / newsblur-cl.py
Created November 30, 2011 03:36
Python command interpreter interface to NewsBlur API
#!/usr/bin/env python
"""Command interpreter interface to NewsBlur API.
Prerequisite: A checkout of the NewsBlur Python API library.
The upstream version is here:
https://github.com/samuelclay/NewsBlur.git
@ngoffee
ngoffee / rtm2org.py
Created November 19, 2011 17:50
Convert Remember the Milk tasks feed to Emacs org-mode file
#!/usr/bin/env python
# rtm2org.py
#
# Convert Remember the Milk tasks feed to Emacs org-mode file
#
# requires Python >= 2.7 (for ElementTree.iter())
#
# Find your RTM Atom feed here:
# https://www.rememberthemilk.com/atom/<username>