Skip to content

Instantly share code, notes, and snippets.

import time
from tornado.concurrent import run_on_executor
from concurrent.futures import ThreadPoolExecutor # `pip install futures` for python2
MAX_WORKERS = 4
class Handler(tornado.web.RequestHandler):
executor = ThreadPoolExecutor(max_workers=MAX_WORKERS)
@vuuvv
vuuvv / sbt_china_mirror
Created March 27, 2016 13:11 — forked from manuzhang/sbt_china_mirror
sbt China mirror
[repositories]
local
oschina: http://maven.oschina.net/content/groups/public/
oschina-ivy: http://maven.oschina.net/content/groups/public/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
typesafe: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
#sonatype-oss-releases
#maven-central
#sonatype-oss-snapshots
#!/bin/sh
# Detects which OS and if it is Linux then it will detect which Linux
# Distribution.
OS=`uname -s`
REV=`uname -r`
MACH=`uname -m`
GetVersionFromFile()
{
docker rm $(docker ps -a -q)
@vuuvv
vuuvv / 0_reuse_code.js
Created April 3, 2016 01:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
sudo yum install -y ruby ruby-devel lua lua-devel luajit \
luajit-devel ctags git python python-devel \
python3 python3-devel tcl-devel \
perl perl-devel perl-ExtUtils-ParseXS \
perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \
perl-ExtUtils-Embed
sudo apt-get remove vim vim-runtime gvim
yum install ncurses-devel
@vuuvv
vuuvv / repositories
Last active June 11, 2017 10:23
sbt repositories
sbt运行时经常需要下载大量的jar包,默认连接到maven官网,速度通常比较慢。在~/.sbt/下添加一个repositories文件,里面内容如下
[repositories]
local
osc: http://maven.aliyun.com/nexus/content/repositories/central/
typesafe: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
sonatype-oss-releases
maven-central
sonatype-oss-snapshots
@vuuvv
vuuvv / ubuntu 阿里云 镜像
Created June 18, 2017 14:16
ubuntu 阿里云 镜像
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted