Skip to content

Instantly share code, notes, and snippets.

View awalterschulze's full-sized avatar
🇿🇦
Learning LeanProver

Walter Schulze awalterschulze

🇿🇦
Learning LeanProver
View GitHub Profile
@awalterschulze
awalterschulze / Makefile
Created February 2, 2017 13:27
golang: How to check whether a function is inlined
all:
make build
make objdump
build:
go build -gcflags -m main.go
objdump:
go tool objdump -s "main.main" main | grep CALL
@awalterschulze
awalterschulze / wait.js
Created August 22, 2016 07:19
benchmark html page render - javascript
var start = Date.now();
$.ajax({
method: 'GET',
url: 'someurl'
})
.done(function () {
$someElement.html('<div id="results"></div>');
console.log("done", Date.now() - start);
})
.fail(function () {
@awalterschulze
awalterschulze / main.go
Last active June 1, 2016 08:18
golang flag library
package "main"
import "somelibrary"
import "flags"
func main() {
someFlag := somelibrary.Impls.Flag()
flags.Parse()
someImpl := somelibrary.GetImpl(someFlag)
run(someImpl)
@awalterschulze
awalterschulze / link
Created May 30, 2016 12:33
memory profiling and looking for escapes to heap
@awalterschulze
awalterschulze / .bash_profile
Created February 25, 2016 13:31
view graph from selected text in iterm
alias viewgraph='pbpaste | dot -Tpdf | open -f -a /Applications/Preview.app'
<!DOCTYPE HTML><html lang="en-US" prefix="og: http://ogp.me/ns#"><head><link rel="stylesheet" type="text/css" href="https://cdn.n0where.net/wp-content/cache/minify/000000/c455a/default.include.6ddebb.css" media="all" /><script defer type="text/javascript" src="https://cdn.n0where.net/wp-content/cache/minify/000000/c455a/default.include.80798f.js"></script><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"><link rel="shortcut icon" href="https://cdn.n0where.net/wp-content/uploads/2014/03/favicon.gif" /><meta property="og:image" content="https://cdn.n0where.net/wp-content/uploads/2015/06/systemd.jpg" /><title>Understanding Systemd</title><script type="text/javascript">var ajaxurl='https://n0where.net/wp-admin/admin-ajax.php',ap_nonce='63f0fe5e7b',ap_max_tags='5';disable_hover_card=false;</script><meta name="robots" content="noodp,noydir"/><meta name="description" content="Understanding systemd - suite of sy
@awalterschulze
awalterschulze / bash.profile
Created August 25, 2015 08:12
Finding Concurrency Bugs
function repeattest {
go test -c
while [ $? -eq 0 ]; do
GOMAXPROCS=$[ 1 + $[ RANDOM % 100 ]] ./`ls *.test` -test.v $1 2>&1
done
}
@awalterschulze
awalterschulze / bash.profile
Last active February 25, 2016 13:31
My Favourite Aliases
alias s='git status'
alias test='go test -v 2>&1'
alias d='git diff'
alias f='gofmt -w -s -l .'
@awalterschulze
awalterschulze / ProfilingGo.sh
Created August 25, 2015 08:08
Profiling Go
./test.test -test.cpuprofile=x.prof -test.run=XXX -test.bench=MyBenchmark
go tool pprof --svg test.test x.prof > x.svg
@awalterschulze
awalterschulze / AutoChangeEnviron.md
Created August 25, 2015 08:07
Automatically Changing Environments