Skip to content

Instantly share code, notes, and snippets.

View tsavola's full-sized avatar

Timo Savola tsavola

View GitHub Profile
@tsavola
tsavola / connpair.go
Created April 1, 2016 00:38
Like socketpair, but for Golang, and TCP instead of Unix sockets
package connpair
import (
"net"
)
func ConnPair() (serverConn, clientConn net.Conn, err error) {
l, err := net.Listen("tcp", "localhost:0")
if err != nil {
return

Keybase proof

I hereby claim:

  • I am tsavola on github.
  • I am tsavola (https://keybase.io/tsavola) on keybase.
  • I have a public key whose fingerprint is 4030 EB46 05B7 1870 76BE 69D2 0D67 D922 595E A3E9

To claim this, I am signing this object:

@tsavola
tsavola / adaptive-wrap-0.5.el
Last active September 19, 2021 16:26
Emacs adaptive-wrap-prefix-mode with tab-indentation awareness
;;; adaptive-wrap.el --- Smart line-wrapping with wrap-prefix
;; Copyright (C) 2011-2013 Free Software Foundation, Inc.
;; Author: Stephen Berman <stephen.berman@gmx.net>
;; Stefan Monnier <monnier@iro.umontreal.ca>
;; Version: 0.5
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by