Skip to content

Instantly share code, notes, and snippets.

View jpcirrus's full-sized avatar

John Purnell jpcirrus

  • University of Otago
  • Dunedin, New Zealand
  • 13:18 (UTC +13:00)
View GitHub Profile
@jpcirrus
jpcirrus / github-pandoc.css
Created January 1, 2016 20:19 — forked from dashed/github-pandoc.css
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
import sys
import webbrowser
import urllib
unstruck = sys.argv[1]
struck = []
for c in unstruck:
struck.append(c)
if c not in ' \t\n':
struck.append(u'\u0338')
{
// Message Actions
"o" = "openMessages:"; // Don't really use this. ⌘o still works
"j" = "markAsJunk:";
"J" = "markAsNotJunk:";
"s" = "toggleFlag:";
"m" = "toggleReadState:";
"a" = ( "setTag:", "\\Seen", "archive:"); // archive and mark read
"A" = ( "selectWithFilter:", "#thread-id = ${#thread-id}","setTag:", "\\Seen", "archive:" ); // Select whole thread, mark as read and archive
"=" = ( "moveToMailbox:",'/Action');
@jpcirrus
jpcirrus / matplotlibrc
Last active August 29, 2015 14:01 — forked from huyng/matplotlibrc
### MATPLOTLIBRC FORMAT
# Forked from: http://www.huyng.com/posts/sane-color-scheme-for-matplotlib/
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overwritten in your next install.
# If you want to keep a permanent local copy that will not be
# overwritten, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# =============================================================
# = OpenMeta to OS X Tags =
# =============================================================
# Script to convert OpenMeta tags to OS X Mavericks tags.
#
# Created by Zettt (Andreas Zeitler) on 2013-06-28
# Source www.macosxscreencasts.com, mosx.tumblr.com
#
# OpenMeta to OS X Tags by Andreas Zeitler is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike
#!/usr/bin/env python
"""
This script is designed to generate a simple html file with _all_ of your
Pinboard.in bookmarks The HTML file can be added to Launchbar's index as a
custom bookmark file and you can search your entire Pinboard.in collection
instantly from Launchbar (by title only). It includes any applied tags as part
of the title to aid in searching.
You should edit the `username`, `bookmark_filename`, and `local_timezone`
# A stupid script that actually makes a handy system service
# Use it to right click files and extract their text content to the clipboard
# Brett Terpstra 2013, no rights reserved
txtcount=`file "$@"|grep -c text`
response=0
msg=""
if [ $txtcount -eq $# ]; then
cat "$@"|pbcopy
if [ "$?" -ne "0" ]; then
msg="Error running command"
-- by Nathan Grigg, http://nb.nathanamy.org
(*
This searches for the last punctuation on the line (but to the left of the cursor)
The first two groupings of the regular expression capture the indentation to \1
and the beginning of the line (up to the punctuation) to \2
Then it looks for .,!?;: followed by spaces or tabs
it captures the punctuation in \3
the white space after the punctuation is ignored
The replacement string is \1\2\3\r\1, which inserts a return after \3 and puts
the same indentation on the next line
### Based on: https://gist.github.com/b0644f5ed1d94bd32805
### This version strips unicode characters from the downloaded script
### to work around the currently limited unicode support of the editor
### module.
# This script downloads and opens a Gist from a URL in the clipboard.
# It's meant to be put in the editor's actions menu.
#
# It works with "raw" and "web" gist URLs, but not with gists that
# contain multiple files or non-Python files.