start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/sh | |
# | |
# a simple way to parse shell script arguments | |
# | |
# please edit and use to your hearts content | |
# | |
ENVIRONMENT="dev" |
import time | |
def RateLimited(maxPerSecond): | |
minInterval = 1.0 / float(maxPerSecond) | |
def decorate(func): | |
lastTimeCalled = [0.0] | |
def rateLimitedFunction(*args,**kargs): | |
elapsed = time.clock() - lastTimeCalled[0] | |
leftToWait = minInterval - elapsed | |
if leftToWait>0: |
{% for post in site.posts %} | |
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3> | |
<p><small><strong>{{ post.date | date: "%B %e, %Y" }}</strong> . {{ post.category }} . <a href="http://erjjones.github.com{{ post.url }}#disqus_thread"></a></small></p> | |
{% endfor %} |
#coding=utf-8 | |
import time | |
import sched | |
import os | |
import threading | |
""" | |
sched模块,准确的说,它是一个调度(延时处理机制),每次想要定时执行某任务都必须写入一个调度。 | |
使用步骤如下: | |
(1)生成调度器: | |
s = sched.scheduler(time.time,time.sleep) |
$ curl -XPUT 'http://localhost:9200/twitter/' -d '{ | |
index : { | |
number_of_shards : 3 | |
number_of_replicas : 2 | |
} | |
}' |
from concurrent.futures import ThreadPoolExecutor | |
from functools import partial, wraps | |
import time | |
import tornado.ioloop | |
import tornado.web | |
EXECUTOR = ThreadPoolExecutor(max_workers=4) |
curl \ | |
--verbose \ | |
--request OPTIONS \ | |
http://localhost:3001/api/configuration/visitor \ | |
--header 'Origin: http://localhost:9292' \ | |
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \ | |
--header 'Access-Control-Request-Method: GET' | |
# http://nils-blum-oeste.net/cors-api-with-oauth2-authentication-using-rails-and-angularjs/#.UQJeLkp4ZyE |
[merge] | |
keepBackup = false | |
tool = p4merge | |
[mergetool "p4merge"] | |
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\"" | |
keepTemporaries = false | |
trustExitCode = false | |
keepBackup = false | |
[diff] | |
tool = p4merge |