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 / 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 / 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;
@dunn
dunn / picture.sh
Last active August 29, 2015 14:09
image scaling for srcset
#!/usr/bin/env bash
SOURCE="$2"
ORIGINAL_SCALE="$1"
EXTENSION=$(echo "$SOURCE" | ag -o "\.[a-z]+$")
# http://hints.macworld.com/article.php?story=20031124140353993
ORIGINAL_W=$(sips -g pixelWidth "$SOURCE" | ag -o "pixelWidth:\ [0-9]+" | sed 's:[^0-9]::g')
ORIGINAL_H=$(sips -g pixelHeight "$SOURCE" | ag -o "pixelHeight:\ [0-9]+" | sed 's:[^0-9]::g')
FILENAME=$(echo "$SOURCE" | sed "s:_*[0-9]*\.[a-zA-Z]*$::")
@dunn
dunn / codes.js
Created November 15, 2014 00:37
shortcodes for the mtgapi
module.exports = {
blocks: [
// not available yet
// 'ktk',
'jou',
'bng',
'ths',
'dgm',
@dunn
dunn / csv-to-array.awk
Created January 4, 2015 23:24
convert the Twitter archive csv file into something useful sheesh
#!/usr/local/bin/gawk -f
# I can't get multiline regular expressions to work well outside of
# TextMate, so before running this on tweets.csv I opened it in
# TextMate and replaced:
# ([^"])\n
# for
# $1\\n
@dunn
dunn / run_nerd.js
Last active August 29, 2015 14:14
lurks in yr slackroom waiting for a chance to talk about magic cards
#!/usr/bin/env node
var request = require('request');
var cheerio = require('cheerio');
var Slack = require('slack-client');
var token = require('./secrets.js').slack,
autoReconnect = true,
autoMark = true;