Skip to content

Instantly share code, notes, and snippets.

View hugovk's full-sized avatar

Hugo van Kemenade hugovk

View GitHub Profile
@hugovk
hugovk / helsinki_metro_stations.csv
Last active March 9, 2016 20:04
Helsinki metro stations, co-ordinates taken from Wikipedia.
Latitude Longitude Name
60.163056 24.914444 Ruoholahti
60.168889 24.931944 Kamppi
60.170556 24.940556 Rautatientori
60.172222 24.9475 Helsingin yliopisto
60.18 24.950556 Hakaniemi
60.1875 24.961111 Sörnäinen
60.1875 24.976944 Kalasatama
60.188889 25.008056 Kulosaari
60.195 25.030833 Herttoniemi
@hugovk
hugovk / define.py
Last active December 10, 2015 18:58 — forked from luisnaranjo733/define.py
#!/usr/bin/env python
'''
I frequently look up word meanings online.
It's kind of a hassle to fire up the browser, and search online after a while.
It's a lot easier for me to do it from the command line, when my terminal is one keyboard shortcut away.
I wrote this script using the wordnik api that does just that.
I suggest you put this somewhere in your PATH, make it executable.
Make sure you get a Wornik API key at http://developer.wordnik.com/
@hugovk
hugovk / Snowball
Last active December 16, 2015 20:48 — forked from nossidge/Snowball
Python version of nossidge's C++ from https://gist.github.com/nossidge/5272238
#!/usr/bin/env python
"""
Python version of nossidge's C++ from https://gist.github.com/nossidge/5272238
Original blurb:
~~ Snowball Poem ~~
Snowball (also called a Chaterism): A poem in which each line is a single word,
and each successive word is one letter longer. One of the constrained writing
techniques invented by the Oulipo (Workshop of Potential Literature).
@hugovk
hugovk / leg.py
Created February 6, 2014 07:07
Hacky script used for renaming (most) of the Wikipedia/Wikimedia photos of members of congress into bioguide IDs for use by https://github.com/sunlightlabs/congress/
#!/usr/bin/env python
import csv
import os
import re
import sys
def mvit(infile, outfile):
for suffix in [
"_113th_Congress_2013",
@hugovk
hugovk / 30s.py
Created June 29, 2014 16:55
Download a file every 30 seconds.
import argparse
import datetime
import os
from twisted.internet import reactor
from twisted.internet import task
# Download an image from a URL every few seconds
parser = argparse.ArgumentParser(
description='Download an image from a URL every few seconds.')
@hugovk
hugovk / darkandstormy.py
Created November 20, 2014 07:08
Dark and Stormy: A 50,006-word recursive story for NaNoGenMo 2014. https://github.com/dariusk/NaNoGenMo-2014/issues/35#issuecomment-63762140
#!/usr/bin/env python
"""
Create a recursive story for NaNoGenMo 2014.
"""
sentence = 'It was a dark and stormy night, the ship was sinking; "Tell us a story, Captain!" the crew begged. The Captain began: '
senlen = len(sentence.split())
target = 50000
@hugovk
hugovk / README.md
Last active August 29, 2015 14:10
Questions arising from a Project Gutenberg corpus
@hugovk
hugovk / pandb.sh
Last active August 29, 2015 14:13
pandb.sh downloads and extracts a database from Pantheon in a local environment. updb.sh extracts the last downloaded DB.
#!/bin/bash
echo $1
DATABASENAME="TODO_ENTER_YOUR_DATABASE_NAME"
# From the Pantheon dashboard Backups tab, copy the temporary link for the
# database. Call this script with that link (in quotes) as a parameter.
if [ -z "$1" ];
then
@hugovk
hugovk / .jshintrc
Last active April 29, 2016 11:50
Gruntfile for Drupal to compile Less to CSS with source maps
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,

Keybase proof

I hereby claim:

  • I am hugovk on github.
  • I am hugovk (https://keybase.io/hugovk) on keybase.
  • I have a public key whose fingerprint is F213 C454 5327 1E8C 046B 98FD 277D DF42 CB72 5F45

To claim this, I am signing this object: