Skip to content

Instantly share code, notes, and snippets.

View derekbrokeit's full-sized avatar

Derek Ashley Thomas derekbrokeit

  • Moffett Field, CA
View GitHub Profile
@derekbrokeit
derekbrokeit / pymol_setup_fix.diff
Last active October 13, 2015 22:48
Patch for pymol's `setup.py` script to be more accomodating to home-brew and non-macports users
--- setup.py 2012-12-12 22:55:39.000000000 +0900
+++ setup_fix.py 2012-12-12 23:04:19.000000000 +0900
@@ -153,10 +153,14 @@
outputheader.close()
outputfile.close()
- EXT = "/opt/local"
+ if os.path.isdir("opt/local"):
+ EXT = "/opt/local"
+ else:
@derekbrokeit
derekbrokeit / imv.py
Created November 16, 2012 06:36
View images with the matplotlib library
#!/usr/bin/env python
# Use the power of matplotlib to display an image file
# This can be helpful when logged in to a remote server
# and you need more power than xview, or may xview hasn't
# been installed.
# 2012 Derek Ashley Thomas
import matplotlib as mpl
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
@derekbrokeit
derekbrokeit / asciidoc.vim
Created February 11, 2012 08:03 — forked from tpope/cucumbertables.vim
making sure that the behavior does not infiltrate other buffers (with different filetype) while in use; also changed to asciidoc
" added '<buffer>' to guard against this mapping from being used in other filetypes
inoremap <buffer><silent><Bar> <Bar><Esc>:call <SID>align()<CR>a
function! s:align()
let p = '^\s*|\s.*\s|\s*$'
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
Tabularize/|/l1
normal! 0
@derekbrokeit
derekbrokeit / grepanki.sh
Created August 2, 2011 07:14 — forked from nicolas-raoul/grepdeck.sh
A script to grep through an Anki deck
#!/bin/sh
#
# Search for a term within an Anki deck.
#
# Usage: grepanki.sh someword
# run "grepanki" without any input for more detailed help
#
# You might want to add special aliases to the .bashrc or .bash_profile files
# alias gpj='grepanki' # searches defaultly
# alias gpr='grepanki -r' # searches the reverse direction