Skip to content

Instantly share code, notes, and snippets.

View haarts's full-sized avatar

Harm Aarts haarts

View GitHub Profile
@haarts
haarts / main.go
Created October 15, 2014 14:50
Get something from the notary
package main
import (
"fmt"
"log"
zmq "github.com/pebbe/zmq4"
)
func main() {
@haarts
haarts / prepare-commit-msg
Created August 5, 2014 08:29
Prepend pivotal feature number to commit message
#!/bin/sh
BRANCH_NAME=$(git symbolic-ref --short HEAD | sed "s/^feature_\([0-9]*\).*/\1/")
if [ -n "$BRANCH_NAME" ]; then
sed -i.bak -e "1s/^/[#$BRANCH_NAME] /" $1
fi
@haarts
haarts / dae_cifar.yaml
Created July 11, 2013 11:57
Denoising autoencoder with CIFAR10. Overfitting like there is no tomorrow.
!obj:pylearn2.train.Train {
"dataset": !obj:pylearn2.datasets.cifar10.CIFAR10 &dataset {
"which_set" : 'train'
},
"model": !obj:pylearn2.models.autoencoder.DenoisingAutoencoder {
"nvis" : 3072,
"nhid" : 400,
"irange" : 0.05,
"corruptor": !obj:pylearn2.corruption.BinomialCorruptor {
"corruption_level": 0.5,
@haarts
haarts / crashplan.yaml
Created November 25, 2012 00:59
crashplan for Pi
---
- hosts: pi
user: pi
sudo: yes
tasks:
- name: install java
action: apt pkg=openjdk-6-jre state=installed
- name: install JNA
action: apt pkg=libjna-java state=installed
- name: move patched lib
@haarts
haarts / example.go
Created November 16, 2012 15:01
Read a Photo with libccv
package main
/*
#include "ccv.h"
*/
import "C"
import (
"fmt"
"unsafe"
@haarts
haarts / torrc
Created October 15, 2012 09:50
Tor configuration file
## Configuration file for a typical Tor user
## Last updated 16 July 2009 for Tor 0.2.2.1-alpha.
## (May or may not work for much older or much newer versions of Tor.)
##
## Lines that begin with "## " try to explain what's going on. Lines
## that begin with just "#" are disabled commands: you can enable them
## by removing the "#" symbol.
##
## See 'man tor', or https://www.torproject.org/tor-manual.html,
## for more options you can use in this file.
@haarts
haarts / tor.conf
Created August 31, 2012 20:13
RaspberryPi Tor monit configuration (bonus: vnstat monit configuration)
# Tor is leaking memory. Restart when necessary.
check process tor with pidfile /var/run/tor/tor.pid
start program = "/usr/sbin/tor -f /etc/tor/torrc"
stop program = "/bin/sh -c '/bin/kill -s SIGTERM `cat /var/run/tor/tor.pid` && rm /var/run/tor/tor.pid'"
if mem > 64 MB for 3 cycles then restart
@haarts
haarts / Gemfile
Created March 19, 2012 15:20 — forked from shardnit/dump_bitcask_data.rb
Dump Riak Bitcask data locally
source 'http://rubygems.org'
gem 'bitcask'
gem 'bert'
@haarts
haarts / gist:1940344
Created February 29, 2012 11:56
Sample has_child query
{
"query" : {
"has_child" : {
"type" : "interaction",
"query" : {
"term" : {
"text" : "tree"
}
}
}
@haarts
haarts / gist:1939980
Created February 29, 2012 10:57
ElasticSearch model evolution
//simple
{
"picture_url" : "http://foobar.com/1234",
"text" : "some text"
"user_name" : "John"
"created_at" : 2012-2-29
}
//embedded
{