Skip to content

Instantly share code, notes, and snippets.

View iwdmb's full-sized avatar
🐽

Ming iwdmb

🐽
View GitHub Profile
@iwdmb
iwdmb / acknowledgment_test.go
Created June 5, 2019 08:34 — forked from rcrowley/acknowledgment_test.go
Benchmark of goroutine acknowledgment patterns
// Go encourages us to organize our code using goroutines and to use
// channels of channels to implement request-response semantics [1].
//
// I have encountered far more instances that require acknowledgment
// than fully-fledged respones so I became curious whether channels
// of channels were indeed the best implementation strategy.
//
// In summary, yes, they are. These benchmarks demonstrate that
// channels perform better than mutexes, that condition variables are
// still clumsy, and that preallocation is a huge win when and if you
@iwdmb
iwdmb / install_gtest_ubuntu.md
Created June 4, 2019 05:38 — forked from Cartexius/install_gtest_ubuntu.md
Install gtest in Ubuntu
<?php
/**
* GitHub webhook handler template.
*
* @see https://developer.github.com/webhooks/
* @author Miloslav Hůla (https://github.com/milo)
*/
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check
@iwdmb
iwdmb / web-servers.md
Created January 2, 2016 13:53 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@iwdmb
iwdmb / git_prompt_info.zsh
Created November 15, 2015 09:26 — forked from msabramo/git_prompt_info.zsh
The slowness of my zsh prompt when in a git-svn managed directory was killing me. I improved it by removing the git status stuff that slows it down...
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}