Skip to content

Instantly share code, notes, and snippets.

View afandian's full-sized avatar

Joe Wass afandian

  • Crossref
  • Oxford, UK
View GitHub Profile
#!/usr/bin/env python3
# pip3 install requests
import requests
ignore_prefix = len('http://id.crossref.org/prefix/')
cursor = "*"
@afandian
afandian / plotter.go
Created July 25, 2012 21:27
A Go program that plots sound files into PNGs. Uses libdndfile + gosndfile
package main
// plotter.go
// Joe Wass 2012
// joe@afandian.com
import (
"fmt"
"image"
"image/color"
@afandian
afandian / testclient.py
Created January 20, 2011 21:00
testclient.py
import httplib
ip = "127.0.0.1"
conn = httplib.HTTPConnection("localhost", 10000) # address and port of server
conn.request("GET", "/ping/%s/"%ip)
response = conn.getresponse()
pingOk = False
@afandian
afandian / pingserver.py
Created January 20, 2011 20:52
Ping Server
import web
import subprocess
urls = (
'/ping/(.*)/', 'ping'
)
app = web.application(urls, globals())
class ping:
@afandian
afandian / WebserviceConsumerDemo.java
Created January 18, 2011 23:46
WebserviceConsumerDemo
import HTTPClient.*;
import java.io.*;
/* trying to get this bit to work. Without it you get an annoying dialogue box asking about cookies permission.
class FolktunePolicyHandler implements CookiePolicyHandler
{
boolean acceptCookie(Cookie cookie, RoRequest req, RoResponse resp)
{
// yeah whatever
return true;