Skip to content

Instantly share code, notes, and snippets.

View icsaas's full-sized avatar
🎯
saasing

iac icsaas

🎯
saasing
View GitHub Profile
@bdarnell
bdarnell / fdserver.py
Created July 9, 2011 20:41
Demonstration of sharing file descriptors across processes
#!/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).
@mrjoes
mrjoes / INSTALL.txt
Last active February 2, 2018 21:25
Dead simple broker on top of sockjs-tornado
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
@illerucis
illerucis / gist:4586359
Last active September 2, 2022 19:01
Server-side Python + MongoDB + Flask implementation for DataTables
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,
@yyx990803
yyx990803 / api.html
Last active May 19, 2023 23:17
连续请求ajax API回调顺序的问题
<!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
@astrojuanlu
astrojuanlu / pool_futures.py
Last active June 20, 2019 11:28
Comparison between multiprocessing Pool and ProcessPoolExecutor from concurrent.futures.
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
anonymous
anonymous / Makefile
Created December 15, 2013 11:58
Hedging client for Ripple
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

基础知识

  • 计算机软硬件基础
  • 计算机网络
  • 操作系统
  • 数据结构和算法
  • 设计模式
  • 以及其他各种你应该懂的东西

前端开发

  • 前端标准/规范
@kingbin
kingbin / GitLab-CE on Windows 10
Last active May 22, 2020 20:15
Using Docker toolbox to create a persistent Gitlab-CE install in Windows 10
$ 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