Skip to content

Instantly share code, notes, and snippets.

@nindalf
nindalf / Go deadlock
Last active August 29, 2015 13:57
Error while developing gotop
fatal error: all goroutines are asleep - deadlock!
goroutine 1 [chan receive]:
testing.RunTests(0x57ba68, 0x68d280, 0xa, 0xa, 0x1)
/usr/local/go/src/pkg/testing/testing.go:472 +0x8d5
testing.Main(0x57ba68, 0x68d280, 0xa, 0xa, 0x691500, ...)
/usr/local/go/src/pkg/testing/testing.go:403 +0x84
main.main()
github.com/nindalf/gotop/_test/_testmain.go:65 +0x9c

Go is a general-purpose language that bridges the gap between efficient statically typed languages and productive dynamic language. But it’s not just the language that makes Go special – Go has broad and consistent standard libraries and powerful but simple tools.

Go was developed by engineers working at Google. It was built with the idea of helping Google's engineers develop applications at scale. A couple of Go projects at Google are the server powering dl.google.com and the database layer of YouTube. In the last couple of years, it has gained traction amongst other industry heavyweights such as Mozilla (Heka), Canonical (Juju), Heroku (Doozer), Cloudflare (Railgun), [Bitly](

@nindalf
nindalf / 01 - Android Memory.md
Last active August 29, 2015 14:04
Android sessions

###Android Memory

To find out how much memory you have available for your app - ActivityManager.getMemoryClass() Android G1 - 16MB Motorola Xoom - 48GB

If you need more, use android:largeHeap = "true"

Can't just ask for more memory though. Using the large heap option and getting more memory means more time spent in garbage collection.

@nindalf
nindalf / dwarves.py
Last active January 7, 2018 08:27
Fivethirtyeight dwarves problem
permutations = []
def next_step(permutation, dwarf):
if dwarf == 7:
permutations.append(tuple(permutation))
return
if permutation[dwarf] == -1:
permutation[dwarf] = dwarf
next_step(permutation, dwarf + 1)
@nindalf
nindalf / nginx-config-result.txt
Created February 6, 2020 16:19
Snippets for setting up hugo
To Action From
-- ------ ----
Nginx Full ALLOW Anywhere
22/tcp ALLOW Anywhere
22 ALLOW Anywhere
Nginx Full (v6) ALLOW Anywhere (v6)
22/tcp (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)