Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
# 指定Nginx工作的用户和用户组,www-data 是我们新建的一个虚拟用户 | |
user www-data www-data; | |
# 指定Nginx工作的进程数,默认是1。建议参考CPU内核数,双核处理器又是超线程的话可以设置为4个,避免进程堵塞在IO等待中。 | |
worker_processes 4; | |
events { | |
use epoll; # 指定I/O模式,epoll是Linux内核2.6(或以上)中一种比较高效的异步IO模型 | |
worker_connections 8000; # 规定单个进程可以处理的请求数 | |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
""" | |
A file lock implementation that tries to avoid platform specific | |
issues. It is inspired by a whole bunch of different implementations | |
listed below. | |
- https://bitbucket.org/jaraco/yg.lockfile/src/6c448dcbf6e5/yg/lockfile/__init__.py | |
- http://svn.zope.org/zc.lockfile/trunk/src/zc/lockfile/__init__.py?rev=121133&view=markup | |
- http://stackoverflow.com/questions/489861/locking-a-file-in-python | |
- http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/ | |
- http://packages.python.org/lockfile/lockfile.html |
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed. | |
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
# | |
# Deployment structure | |
# | |
# SERVER: | |
# /etc/init.d/nginx (1. nginx) | |
# /home/app/public_html/app_production/current (Capistrano directory) | |
# |
virtualenv --no-site-packages hodor | |
hodor/bin/pip install simplejson ujson cbor tnetstring msgpack-python | |
curl -s 'http://www.json-generator.com/api/json/get/cvfsLVmKiG?indent=2' > test.json | |
hodor/bin/python shootout.py |
#!/bin/bash | |
# Extract a subproject's master branch from a specified repo into a new | |
# repository in the target directory, preserving history. | |
# usage: git-subdir-newrepo.sh path/to/repo newrepo_path subproject_path | |
# Based on stuff I found here: | |
# http://airbladesoftware.com/notes/moving-a-subdirectory-into-a-separate-git-repository | |
EXPECTED_ARGS=3 | |
E_BADARGS=65 |
为了更全面的展示你自己,你可以回答以下题目,每个问题你都可以不作答,不会减分,只是答的好的话会加分。 | |
1. 有哪些兴趣爱好和擅长 | |
2. 常去哪些技术网站和社区 | |
3. 参与过开源项目,做了什么贡献 | |
4. 常用哪些组件,库或框架,哪个是你最熟悉最拿手的 | |
5. 完整看完过哪些技术书籍,哪本是你反复看过的,哪本对你影像最大 | |
6. 使用过哪些编程语言,最擅长哪个语言? | |
7. 有没有自己的域名,网站,博客,github,stackoverflow ,v2ex,知乎,微博,twitter,google plus账号 | |
8. 精通正则表达式吗? | |
9. c学的如何? 计算机组成原理学的咋样? |