Skip to content

Instantly share code, notes, and snippets.

View jarvys's full-sized avatar

Jarvis Young jarvys

View GitHub Profile
@jarvys
jarvys / phone.js
Created November 17, 2014 06:10
validator for phone number in China
/^(13[0-9]|15[012356789]|18[0-9]|14[57])[0-9]{8}$/
@jarvys
jarvys / nginx.conf
Created December 7, 2014 00:47
template nginx config file for node web app
server {
listen 80;
server_name smile.limijiaoyin.com;
access_log /var/log/nginx/smile.access.log;
error_log /var/log/nginx/smile.error.log;
client_max_body_size 200m;
keepalive_timeout 9000;
gzip on;
@jarvys
jarvys / get_connections.sh
Created December 11, 2014 09:56
get tcp connections
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
  • test
    • test1
  • test2
@jarvys
jarvys / wiki.md
Created June 10, 2015 12:00
厘米脚印开发wiki
@jarvys
jarvys / server-checklist.md
Created June 26, 2015 06:25
服务器搭建 checklist
  • 安装sysstat(sar)
/**
* Base constructor for all React elements. This is only used to make this
* work with a dynamic instanceof check. Nothing should live on this prototype.
*
* @param {*} type
* @param {string|object} ref
* @param {*} key
* @param {*} props
* @internal
*/
@jarvys
jarvys / list-all-crontab.sh
Created September 23, 2015 02:45
list all crontabs
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done