Skip to content

Instantly share code, notes, and snippets.

package gaff.dali.jdbi;
import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.tweak.ResultColumnMapper;
import org.skife.jdbi.v2.tweak.ResultSetMapper;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
#!/usr/bin/env python3
from pydbus import SystemBus
from gi.repository import GLib
from functools import partial
import logging
import os
TIMEOUT = 900
event = 0
@Gaff
Gaff / JdbProcessor.java
Last active August 12, 2016 09:19
JDBI + Immutables annotation processor
package gaff.annotationprocessors;
import com.github.mustachejava.DefaultMustacheFactory;
import com.github.mustachejava.Mustache;
import com.github.mustachejava.MustacheFactory;
import gaff.jdbi.Jdbi;
import javax.annotation.processing.*;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
@Gaff
Gaff / DIY-VPN-with-docker.md
Created September 3, 2015 06:26
Become your own VPN provider in 15 minutes with Docker

It's VERY easy to setup your own VPN with docker. This guide assumes you're ok with operating a linux box but know nothing about docker. I'll break it down into 4 easy steps:

1. Setup a docker host

I'm using bithost, so the steps here are:

  • Sign up and pay them some bitcoins :)
  • Generate a pgp key (digitalocean have detailed instructions on this step)
  • Upload the key
  • Launch a new host - I used ubuntu 14.04 image, but any platform that support docker will work.

Is Gist as good as a blog?

Probably. Jekyll was neat but a real PITA to setup.

block quotes work - what more matters?

I can also edit stuff. Woohoo