Skip to content

Instantly share code, notes, and snippets.

View jarvys's full-sized avatar

Jarvis Young jarvys

View GitHub Profile
@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
/**
* 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 / server-checklist.md
Created June 26, 2015 06:25
服务器搭建 checklist
  • 安装sysstat(sar)
@jarvys
jarvys / wiki.md
Created June 10, 2015 12:00
厘米脚印开发wiki
  • test
    • test1
  • test2
@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]}'
@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 / 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 / requirements.txt
Last active August 29, 2015 14:08
requirements.txt
#--index-url http://pypi.douban.com/simple
Django==1.7
django-auth-remember
django-render-json
django-render-csv
django-auth-json
python-memcached
django-social-auth
django-tables3
@jarvys
jarvys / login_and_logout.py
Last active August 29, 2015 14:08
login and logout views for django
# coding: utf-8
import django.contrib.auth as auth
from django.views.decorators.http import require_http_methods, require_GET, require_POST
@require_http_methods(['GET', 'POST'])
@ensure_csrf_cookie
def login(request):
if request.method == 'GET':
return render(request, "login.html")