Skip to content

Instantly share code, notes, and snippets.

A. Sebastian Dietzel albsen

View GitHub Profile
albsen / syncthing
Created Nov 18, 2015 — forked from arudmin/syncthing
/etc/init.d/syncthing script for Raspberry Pi (or any Ubuntu/Debian)
View syncthing
# Provides: syncthing
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of syncthing.
albsen / haproxy-ssl.cfg
Last active Sep 9, 2015 — forked from christiannelson/haproxy-ssl.cfg
HAProxy Configurations
View haproxy-ssl.cfg
# References:
nbproc 2
maxconn 16384
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
componentDidMount() {
this.setState({ data: 'Hello' });
render() {
# Alot of these configs have been taken from the various places
# on the web, most from here
# Set the colours you can use

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:

Docker Cheat Sheet


Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

View finagle.scala
package com.nascency.incipit
import com.twitter.finagle.{Service, SimpleFilter}
import org.jboss.netty.handler.codec.http._
import org.jboss.netty.handler.codec.http.HttpResponseStatus._
import org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1
import org.jboss.netty.buffer.ChannelBuffers.copiedBuffer
import org.jboss.netty.util.CharsetUtil.UTF_8
import com.twitter.util.Future
View SQL_Comparitor.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import subprocess
# PyObjC-related imports
from AppKit import NSApplication, NSSystemDefined
from PyObjCTools import AppHelper
KEY_UP = 11
albsen /
Created Nov 12, 2012 — forked from WheresAlice/
Python DNS server with Redis backend
# A naive dns server with a Redis backend
# Set keys in Redis you want to be authoritative for (set
# Tip: Use Redis's ttl functions to have temporary names
# Currently only does A records, feel free to fix that
# Licensed under the PSF License
# Thanks to:
# Author: @Kaerast <>
import socket
You can’t perform that action at this time.