Skip to content

Instantly share code, notes, and snippets.

@nindalf
nindalf / nginx-config-result.txt
Created Feb 6, 2020
Snippets for setting up hugo
View nginx-config-result.txt
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)
@nindalf
nindalf / dwarves.py
Last active Jan 7, 2018
Fivethirtyeight dwarves problem
View dwarves.py
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)
View 01 - Android Memory.md

###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.

View intro-to-go.md

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 / Go deadlock
Last active Aug 29, 2015
Error while developing gotop
View Go deadlock
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