Skip to content

Instantly share code, notes, and snippets.

View dunn's full-sized avatar
💭
no

Alexandra Catalina dunn

💭
no
View GitHub Profile
@dunn
dunn / phead.pl
Created July 8, 2012 07:15
BBEdit/TW filter for pandoc header IDs
#!/usr/bin/perl
# written by Alex Dunn in 2012
# this code may be used for any purpose whatever
# this script is shitty and will not always produce correct header
# identifers; everything that should occur is documented at:
# http://johnmacfarlane.net/pandoc/README.html#header-identifiers-in-html-latex-and-context
use strict;
@dunn
dunn / phil.sh
Last active October 12, 2015 10:48
script to find papers
#!/bin/bash
# I have a lot of PDFs from JSTOR and elsewhere, and it's
# a chore to scroll them through manually. I've got a
# naming convention (frege1948.pdf, for example), so it's
# easy to search by filename and find the one I need.
PATH_TO_PAPERS_DIR=""
query="$1"
matches=""
@dunn
dunn / md2pdf.sh
Last active December 14, 2015 10:29
simple markdown-to-PDF wrapper for pandoc
#!/bin/bash
open=0
input=""
shortname=""
if [[ "$1" == "o" || "$1" == "-o" ]]
then
open="1"
input="$2"
@dunn
dunn / ucsb.sh
Created February 8, 2014 03:21
convert official ucsb eps for the new philosophy website
convert -density 125 -colorspace rgb -negate ucsbseal.eps -fuzz %25 -transparent black -white-threshold %75 ucsb_white.png
@dunn
dunn / twet.js
Created May 31, 2014 22:46
parsing Twitter API dates with moment.js
var tweetTime = moment('Wed May 28 05:51:51 +0000 2014', "ddd MMM D HH:mm:ss ZZ YYYY");
@dunn
dunn / mutual.js
Last active August 29, 2015 14:02
use node and twit to look at relationships between twitterers
#!/usr/bin/env node
var Twit = require('twit');
var async = require('async');
var T = new Twit({
consumer_key: '😈',
consumer_secret: '😈',
access_token: '😈',
access_token_secret: '😈'
@dunn
dunn / ghost.scss
Created July 17, 2014 22:27
how to do spinning animations with css
.ghost::before {
content: "👻";
padding-right: 5em;
font-style: normal;
/* position: fixed or absolute is absolutely essential and nobody told me */
position: absolute;
-webkit-animation: ghost 4s linear infinite;
-moz-animation: ghost 4s linear infinite;
-o-animation: ghost 4s linear infinite;
@dunn
dunn / googleCalDateParser.js
Last active August 29, 2015 14:06
turn the crappy date strings from google calendar xml into Moment objects
var moment = require('moment-timezone');
module.exports = function(input){
var eventTimes = {
start: false,
end: false
};
var a,b;
var splitMarker = input.indexOf('to');
@dunn
dunn / gara.cls
Last active August 29, 2015 14:06
custom markdown → latex
%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
%% The LaTeX3 Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file was generated from file(s) of the LaTeX base system.
%% --------------------------------------------------------------
%%
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
// demystified by ben jeffrey:
// https://benjeffrey.com/posts/pandoc-syntax-highlighting-css
// https://github.com/jeffbr13/benjeffrey.com/blob/master/src/scss/_syntax-highlighting-solarized-light.scss
pre,
code {
background-color: $base03;
color: $base3;
font-family: 'Consolas', 'Input Mono', 'Monaco', monospace;
padding: 2px;