Skip to content

Instantly share code, notes, and snippets.

Working from home

David Wu TangMonk

Working from home
View GitHub Profile
emilstahl /
Created Jan 17, 2016
Get iOS device UDID in terminal
system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2}'
dergraf / vernemq_grafana.json
Created Oct 16, 2015
VerneMQ Grafana Single Node Dashboard
View vernemq_grafana.json
"id": 1,
"title": "VerneMQ",
"originalTitle": "VerneMQ",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": false,
"sharedCrosshair": false,
blackgear / userstyle.styl
Last active Dec 21, 2021
I hate ugly font
View userstyle.styl
'Arial Black' : 'ENG',
'Arial' : 'ENG',
'Calibri' : 'ENG',
'Cambria' : 'ENG',
'Candara' : 'ENG',
'Comic Sans MS' : 'ENG',
'Constantia' : 'ENG',
'Corbel' : 'ENG',
'Georgia' : 'ENG',
grillermo / .vimrc
Created Mar 6, 2015
Ctrlp using ag the silver searcher
View .vimrc
"" The Silver Searcher
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" " ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
GiaoGiaoCat / wechat-useragent.js
Created Mar 6, 2015
View wechat-useragent.js
// 检测浏览器的 User Agent 应该是非常简单的事情
// 微信在 Android 下的 User Agent
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/
// 微信在 iPhone 下的 User Agent
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0
// 通过javascript判断
// 很容易看出来,微信的 User Agent 都有‘micromessenger’字符串标示,我们判断是否含有这些字符串就OK了
function isWeixinBrowser(){
klzgrad /
Created Nov 17, 2014






pnc /
Last active Aug 15, 2022
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
lyoshenka /
Last active Aug 28, 2022
How to setup Ngrok with a self-signed SSL cert


The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.


Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is, you'll need a record for that and for *

Different Operating Systems

danwit / node_acl_example.js
Created Apr 26, 2014
Authorization with node_acl + mongo + express
View node_acl_example.js
* Simple node_acl example with mongoDB and expressjs
* Usage:
* 1. Start this as server
* 2. Play with the resoures
* Show all permissions (as JSON)
* http://localhost:3500/info
redism / client.js
Created Apr 25, 2014
Simple server performance test
View client.js
* A simple client for performance benchmark
* Created by redism on 2014. 4. 22..
var SocketIO = require(''),
argv = require('optimist').argv;
var n = argv.n || 10;