- 计算机软硬件基础
- 计算机网络
- 操作系统
- 数据结构和算法
- 设计模式
- 以及其他各种你应该懂的东西
- 前端标准/规范
#!/usr/bin/env python | |
"""This is a demonstration of sharing file descriptors across processes. | |
It uses Tornado (need a recent post-2.0 version from github) and the | |
multiprocessing module (from python 2.6+). To run it, start one copy | |
of fdserver.py and one or more copies of testserver.py (in different | |
terminals, or backgrounded, etc). Fetch http://localhost:8000 and | |
you'll see the requests getting answered by different processes (it's | |
normal for several requests to go to the same process under light | |
load, but under heavier load it tends to even out). |
1. pip install -r reqs.pip | |
2. server.py | |
3. open client.html in browser | |
4. redis-cli publish push '123456' | |
5. check browser console |
from collections import namedtuple | |
from pymongo import MongoClient | |
from flask import request | |
from core.web.site import app | |
from core.web.site.views_master import * | |
import json | |
''' | |
$('#companies').dataTable( { | |
"bProcessing": true, |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<script> | |
// coolshell api | |
function xss_ajax(url, callback) { | |
var script_id = null; | |
var script = document.createElement('script'); |
This gist is for my post: http://www.andretw.com/2013/07/using-celery-right-now-and-more-best-practices-1.html |
def hard_work(n): | |
""" A naive factorization method. Take integer 'n', return list of | |
factors. | |
""" | |
# Do some CPU bond work here | |
if n < 2: | |
return [] | |
factors = [] | |
p = 2 |
HEDGE = node riphedge | |
all: | |
npm install ripple-lib | |
hedge: | |
-while date; do \ | |
$(HEDGE); \ | |
sleep 100; \ | |
done |
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
$ docker create --name gitlab-data --volume /d/docker/gitlab:/etc/gitlab gitlab/gitlab-ce:latest | |
# Make sure Bridging is set on the VM in VirtualBox | |
$ docker run --publish 8080:80 --publish 2222:22 --publish 4443:443 --name gitlab --restart always --volumes-from gitlab-data gitlab/gitlab-ce:latest | |
Using docker 1.13.1 |