Skip to content

Instantly share code, notes, and snippets.

View souvikhaldar's full-sized avatar
🌴
On vacation

Souvik Haldar souvikhaldar

🌴
On vacation
View GitHub Profile
@rogiervandenberg
rogiervandenberg / main.go
Created October 5, 2020 13:13
Basis Golang HTTP REST server - Best practices interpreted
/*
Based on the video's and blogposts of Mat Ryer (@matryer)..
- https://pace.dev/blog/2018/05/09/how-I-write-http-services-after-eight-years.html
- https://www.youtube.com/watch?v=FkPqqakDeRY
- https://www.youtube.com/watch?v=rWBSMsLG8po
.. I derived the following starting point for a GO HTTP REST server. It can be used to add all explained (see above) concepts.
You could spread the code below in separate files as follows:
# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
@chjj
chjj / bitcoin.md
Created April 16, 2016 09:52
The bitcoin paper in markdown (because PDFs suck)

Bitcoin: A Peer-to-Peer Electronic Cash System

Satoshi Nakamoto [email protected] (www.bitcoin.org)

Abstract. A purely peer-to-peer version of electronic cash would allow online payments to be sent directly from one party to another without going through a financial institution. Digital signatures provide part of the solution, but the main benefits are lost if a trusted third party is still required to prevent double-spending. We propose a solution to the double-spending problem using a peer-to-peer network. The network timestamps transactions by hashing them into

@rboyd
rboyd / random-str.clj
Created February 28, 2013 03:30
random string (clojure)
(defn rand-str [len]
(apply str (take len (repeatedly #(char (+ (rand 26) 65))))))