Skip to content

Instantly share code, notes, and snippets.

View hugovk's full-sized avatar

Hugo van Kemenade hugovk

View GitHub Profile
@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

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:

@hugovk
hugovk / README.md
Last active August 29, 2015 14:21
Cutthroat verb-nouns

Cutthroat verb-nouns

David-Antoine Williams writes:

What is the difference between a catch-all and a catch-phrase? Both are compounds formed as Verb+Noun, but in catch-all, the noun is the direct object of the verb, whereas in catch-phrase it is the subject. That is, a catch-all is something that catches all things, whereas a catch-phrase is not something that catches phrases – it is a phrase that catches something. Get it?

Recently there has been some discussion of catch-all type compounds, which Brianne Hughes has named “cutthroat compounds,” after one of the more suggestive of these. Apparently they’re rare, because they violate a general tendency for compounds in English to put the ‘head’ (e.g. phrase) on the right (‘right-headedness’). Compare F. ouvre-bouteille to E. bottle-opener (not open-bo

@hugovk
hugovk / minitest.py
Last active August 29, 2015 14:22
Attempt to download another user's Wordnik list
#!/usr/bin/env python
# encoding: utf-8
from wordnik import swagger, AccountApi, WordListApi
WORDNIK_USERNAME = TODO
WORDNIK_PASSWORD = TODO
WORDNIK_API_KEY = TODO
permalink = "gapeseeds-and-muckworms---compound-derogatives"
@hugovk
hugovk / Vagrantfile
Created June 1, 2015 07:39
A Drupal Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
hostname = 'myvagrant'
domain = 'example.com'
ip = '192.168.54.5'
#forwarded_port = 8080
cpus = 2
ram = 2048
@hugovk
hugovk / HOLD-DOOR-1801.jpg
Last active August 29, 2015 14:22
Cutthroats: A supplement to Johnson's English dictionary (1801)
HOLD-DOOR-1801.jpg