Skip to content

Instantly share code, notes, and snippets.

View icsaas's full-sized avatar
🎯
saasing

iac icsaas

🎯
saasing
View GitHub Profile
#/bin/bash
# Author : laomo <laomo@lmbj.net>
# Donate Address : https://ripple.com//send?to=rQKFznLaiyT55YXSS33fE6NgTjKbrnN4gT
sudo apt-get update
sudo apt-get install libxss1 libstdc++5 ia32-libs freeglut3
#optional(for see the tasks)
sudo apt-get install htop
wget http://boinc.berkeley.edu/dl/boinc_7.2.33_x86_64-pc-linux-gnu.sh
from rq import Queue, Worker, Connection
if __name__ == '__main__':
with Connection():
q = Queue()
Worker(q).work()
from time import sleep
import tornado
from multiprocessing.pool import ThreadPool
_workers = ThreadPool(10)
class BackgroundMix(tornado.web.RequestHandler):
"""将block任务放入线程池中执行
EXAMPLE:
# blocking task like querying to MySQL
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
import time
import tornado.ioloop
import tornado.web
EXECUTOR = ThreadPoolExecutor(max_workers=4)
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
import time
import tornado.ioloop
import tornado.web
EXECUTOR = ThreadPoolExecutor(max_workers=4)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@icsaas
icsaas / par.py
Created February 14, 2014 06:33 — forked from lbolla/par.py
from threading import Thread
def busy_sleep(n):
while n > 0:
n -= 1
N = 99999999
t1 = Thread(target=busy_sleep, args=(N, ))
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
class BaseHandler(tornado.web.RequestHandler):
pass
class HandlerMixin(object):
listeners = []
This Gist is for my post: http://www.andretw.com/2013/10/What-you-should-know-before-using-DataTables.html
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,