Skip to content

Instantly share code, notes, and snippets.

View mhermans's full-sized avatar

Maarten Hermans mhermans

View GitHub Profile
@mhermans
mhermans / open_transparency.md
Created May 11, 2011 09:22
Overview: open data, open source and transparency advocacy
  • LittleSis: "a free database of who-knows-who at the heights of business and government"
  • OpenCorporates: "The Open Database Of The Corporate World"
  • Open Knowledge Foundation: "... create standards like the Open Definition, organize events like Open Government Data Camp, run projects like Where Does My Money Go and and develop tools to help people create, find and share open material"
  • CorpWatch API: "[automated extraction of the] relationship information from ... SEC and provides a free, well-structured interface for programs to query and process the data."
  • Farmsubsidies.org: "Explore European Common Agricultural Policy farm subsidy payments"
  • theyrule.net: "aims to provide a glimpse of some of the relationships of the US ruling class. It takes as its focus the boards of some of the most powerful U.S. companies, which share many of the same directo
@mhermans
mhermans / gist:1046292
Created June 25, 2011 08:33
Setup MongoDB + RabbitMQ + Gabriel
sudo apt-get -y install rabbitmq-server python-virtualenv virtualenvwrapper git mongodb libxslt-dev libxml2-dev python-dev tmux
git clone dvoets@mhermans.webfactional.com:/home/mhermans/webapps/git/repos/gabriel.git
source $HOME/.bashr
mkdir $HOME/.virtualenvs
mkvirtualenv gabrielenv
# Download en configureer WinSCP
# ==============================
# Download WinSCP: http://winscp.net/download/winscp433.zip
# Hiermee kan je citatiebestanden & de output via FTP opladen & afhalen
# Instellingen:
# - Hostname: 46.137.93.234
# - User name: ubuntu
# - private key file: hetzelfde bestand als voor putty
# "Save" de inloggegevens onder een bepaalde naam
# "Login"
{"nodes":[{"title":"Billari2003lifecourse","group":1, "weight":10},{"title":"Goldthorpe2002micro","group":1, "weight":10},{"title":"Goldthorpe1995Constant","group":1, "weight":10},{"title":"Svallfors2002class","group":1, "weight":10}],"links":[{"source":1,"target":0,"value":1},{"source":2,"target":0,"value":1}, {"source":3,"target":0,"value":1}]}
@mhermans
mhermans / neo4R_example.R
Created August 29, 2011 09:50
Neo4j-Cypher-R
# Requirements
#sudo apt-get install libcurl4-gnutls-dev # for RCurl on linux
#install.packages('RCurl')
#install.packages('RJSONIO')
library('RCurl')
library('RJSONIO')
query <- function(querystring) {
h = basicTextGatherer()
{"nodes":[{"label":"UA","group":1, "weight":10},{"label":"PSW","group":1, "weight":10},{"label":"FDC","group":1, "weight":10},{"label":"Faculteitsraad","group":1, "weight":10}],"links":[{"source":0,"target":1,"value":1},{"source":1,"target":2,"value":1}, {"source":1,"target":3,"value":1}]}
Regression models with parametrically weighted explanatory variables
http://books.google.com/books?id=no8M8GAXey8C&pg=PA220&lpg=PA220&dq=diagonal+reference+models+social+mobility&source=bl&ots=VuzHn4EPnH&sig=YQfFg3ST7y7q5gwdNzJLdAQxLqA&hl=en&ei=ldXHTr2ZJYqs-gbwopQy&sa=X&oi=book_result&ct=result&resnum=9&ved=0CFsQ6AEwCA#v=onepage&q=diagonal%20reference%20models%20social%20mobility&f=false
diagonal reference models in R generalized nonlinear model http://rss.acs.unt.edu/Rdoc/library/gnm/html/Dref.html
diagref in Stata
Soreson http://www.jstor.org/pss/2083358
@mhermans
mhermans / ldap.sh
Created December 15, 2011 17:05
LDAP debugging
$ ldapwhoami -x -D CN=stuart,OU=users,DC=testathon,DC=net -H ldap://ldap.testathon.net:389 -w stuart
dn:cn=stuart,ou=Users,dc=testathon,dc=net
Result: Success (0)
@mhermans
mhermans / archiveTwitter.py
Created January 29, 2012 12:42 — forked from mjbommar/archiveTwitter.py
Archive tweets from a search term going backwards through search.
'''
@author Michael J Bommarito II
@date Feb 26, 2011
@license Simplified BSD, (C) 2011.
This script demonstrates how to use Python to archive historical tweets.
'''
import sys
import codecs
@mhermans
mhermans / workfreq.py
Created April 6, 2012 12:00
Python snippet for generating word frequencies for Wordle (using NLTK)
#! /usr/bin/env python
# wordcount.py: parse & return word frequency
import sys, nltk
f = open(sys.argv[1], 'rU')
txt = f.read()
f.close()
tokens = nltk.word_tokenize(txt) # tokenize text
clean_tokens = []