Skip to content

Instantly share code, notes, and snippets.

View deanishe's full-sized avatar

Dean Jackson deanishe

View GitHub Profile
@deanishe
deanishe / search.py
Last active August 29, 2015 13:57
Alfred workflow script filter to perform fuzzy search across a directory subtree
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright © 2014 deanishe@deanishe.net
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2014-03-08
#
@deanishe
deanishe / uninstall_py2.7.sh
Last active August 29, 2015 14:02 — forked from munhitsu/gist:1034761
Uninstall a framework Python on OS X
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
sudo rm -rf "/Applications/Python 2.7"
cd /usr/local/bin
ls -l . | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | xargs rm
@deanishe
deanishe / anki.py
Last active August 29, 2015 14:19
Demonstration of Alfred Script Filter interaction model for entering flash cards
#!/usr/bin/python
# encoding: utf-8
#
# Copyright © 2015 Dean Jackson <deanishe@deanishe.net>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2015-04-20
#
@deanishe
deanishe / tree.md
Created January 3, 2013 23:14 — forked from hrldcpr/tree.md

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@deanishe
deanishe / filter_spotlight.py
Created October 29, 2013 23:59
Benchmarking filtering of Spotlight (mdfind) search results.
#!/usr/bin/env python
# encoding: utf-8
"""
"""
from __future__ import print_function
import sys
import os
@deanishe
deanishe / ABSearch.py
Created December 3, 2013 16:40
Search Mac Address Book with Python via the Scripting Bridge
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: fileencoding=utf-8
"""
Search Mac Address Book contacts via official API
"""
from __future__ import print_function, unicode_literals
import sys
from time import time
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright © 2014 deanishe@deanishe.net
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2014-04-02
#
@deanishe
deanishe / aptparse.zsh
Created November 1, 2016 10:45
Extract installed package names from apt-get output
#!/usr/bin/env zsh
pkgs=()
packages() {
while read ln; do
echo -n "$( echo $ln | cut -d " " -f2 ) "
done
}
@deanishe
deanishe / packal.py
Created March 3, 2014 21:08
Packal.org Alfred Workflow Search
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright © 2014 deanishe@deanishe.net
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2014-03-03
#
@deanishe
deanishe / text_table.py
Created December 26, 2016 09:39
Simple table printer for shell output
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2016 Dean Jackson <deanishe@deanishe.net>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2016-12-19
#