Skip to content

Instantly share code, notes, and snippets.

View patrickmn's full-sized avatar
👷‍♂️

Patrick Mylund Nielsen patrickmn

👷‍♂️
View GitHub Profile
@patrickmn
patrickmn / rowsdos.go
Created December 27, 2011 18:41
Demonstration of Golang weekly.2011-12-22 exp/sql + gopgsqldriver Keep-Alive DoS: *db.Query Rows.Close() is not automatic
package main
// Demonstration of Golang weekly.2011-12-22 exp/sql + gopgsqldriver
// Keep-Alive DoS: *db.Query Rows.Close() is not automatic
import (
"encoding/json"
"exp/sql"
"fmt"
"net/http"
@patrickmn
patrickmn / observer.go
Created January 2, 2012 09:12
Go observer pattern example
package main
import (
"fmt"
"sync"
"time"
)
var wg *sync.WaitGroup
@patrickmn
patrickmn / atomicvsmutex_test.go
Created February 17, 2012 01:01
atomic.StoreInt32 vs. sync.Mutex
package main
// GOMAXPROCS=4 go test --bench=. --parallel=1
import (
"sync"
"sync/atomic"
"testing"
)
After compiling with ghc -O2 -fforce-recomp -ddump-to-file -ddump-simpl -dsuppress-all cycle.hs
==================== Tidy Core ====================
2016-06-13 18:57:32.911884 UTC
Result size of Tidy Core = {terms: 53, types: 46, coercions: 9}
-- RHS size: {terms: 2, types: 0, coercions: 0}
lvl_r4Cf
lvl_r4Cf = I# -1#

Keybase proof

I hereby claim:

  • I am patrickmn on github.
  • I am patrickmn (https://keybase.io/patrickmn) on keybase.
  • I have a public key ASCKQHHD5GHxSPTObKkcmt4f62Pb3Gv-pKtxDR2Sj7JoYgo

To claim this, I am signing this object: