Skip to content

Instantly share code, notes, and snippets.

View pridkett's full-sized avatar
🕺
Rockin the town like a moldy cruton!

Patrick Wagstrom pridkett

🕺
Rockin the town like a moldy cruton!
View GitHub Profile
@pridkett
pridkett / date_shift.py
Created March 20, 2017 01:58
A handy little script to shift the date on a collection of files by a set amount
"""
date_shift.py - timezone sensitive file date modifications
Patrick Wagstrom <patrick@wagstrom.net>
March 19, 2017
this was necessitated after a recent dive trip where I forgot to set the time
on my gopro camera before the first dive. Thus, the timestamp of over video was
off by roughly some fixed amount. This script allows me to calculate the delta
required to shift all the files by the same fixed amount. Once the dates are

Keybase proof

I hereby claim:

  • I am pridkett on github.
  • I am pwagstro (https://keybase.io/pwagstro) on keybase.
  • I have a public key whose fingerprint is E448 0D60 6911 45C2 A7B5 1223 0F7F 3E95 7BA1 A9F0

To claim this, I am signing this object:

@pridkett
pridkett / md5golf.py
Created July 5, 2012 15:13
Calculate the hamming distance between messages from stdin and a given seed message. Used for a contest on Reddit.
import md5
base_message = "I want old gamecube games."
# get the hex digest as an integer
base_md5 = int(md5.md5(base_message).hexdigest(), 16)
starter_seed = "I would like to win your contest. Here's a word to shorten my md5 hamming distance: "
mindist = 128
for word in open("/usr/share/dict/words").readlines():
word = word.strip()
@pridkett
pridkett / graphmlExport.groovy
Created May 13, 2012 22:57
Export the network of the FOLLOWER relationship in gitminer
/**
* This script will create a graphml file with the follower relation
* every user in a gitminer database.
*
* @author Patrick Wagstrom <patrick@wagstrom.net>
*/
/**
* Process the traversal to save FOLLOWER relationships
*
@pridkett
pridkett / brew config
Created April 20, 2011 21:55
brew --config on Mac OS X Leopard with upgraded ruby
HOMEBREW_VERSION: 0.8
HEAD: 4239790b793dca5baaba857437b708b4dd49428b
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.5.8
Kernel Architecture: i386
Ruby: 1.8.7-174
@pridkett
pridkett / brew config
Created April 20, 2011 21:53
brew --config on MacBook Pro (2008ish?) running Mac OS Leopard
HOMEBREW_VERSION: 0.8
HEAD: 4239790b793dca5baaba857437b708b4dd49428b
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.5.8
Kernel Architecture: i386
Ruby: 1.8.6-369
@pridkett
pridkett / ACMSIGS.csl.xml
Created March 3, 2010 19:04
ACM SIGS citation style for Zotero
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://xbiblio.svn.sourceforge.net/viewvc/*checkout*/xbiblio/csl/schema/trunk/csl.rnc" type="compact"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" xml:lang="en">
<info>
<title>ACM SIGS</title>
<id>http://www.zotero.org/styles/acm-sigs</id>
<link href="http://gist.github.com/gists/320873"/>
<author>
<name>Michael Berkowitz</name>
<email>mberkowi@gmu.edu</email>
#!/usr/bin/python
#
# sites_uploader.py
#
# a simple script to upload revised versions of documents onto google sites
__author__ = "Patrick Wagstrom <patrick@wagstrom.net>"
import mimetypes
import gdata
/**
* Arrow 'plugin' for Raphael
**/
Raphael.fn.arrow = function(startx,starty,endx,endy,len,angle,color) {
var arrow;
if (startx.path && startx.type && startx.type == "arrow") {
arrow = startx;
path = arrow.path;
startx = arrow.startx; starty = arrow.starty;
endx = arrow.endx; endy = arrow.endy;