Skip to content

Instantly share code, notes, and snippets.

View yishenggudou's full-sized avatar
🍺
Looking for a partner

Abigail Smithson yishenggudou

🍺
Looking for a partner
View GitHub Profile
#!/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).
@yishenggudou
yishenggudou / carousel.py
Created August 8, 2012 12:04
kivy carousel sample
@yishenggudou
yishenggudou / gist:2667465
Created May 12, 2012 16:28 — forked from ruyrocha/gist:772319
nginx start/stop script (move to /etc/init.d/nginx)
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
<?php
/**
* 解析 视频信息 类
*
* 支持 优酷, 土豆 酷6 56 新浪 qq播客 乐视 乐视
**/
class class_video{
// 超时时间
/**
* @author timger <yishenggudou@gmail.com>
* @timger http://weibo.com/zhanghaibo
* twitter @yishenggudou http://twitter.com/yishenggudou
* @yishenggudou http://twitter.com/yishenggudou
* Copyright (c) 2008-2011 timger - released under MIT License
*/
(
function ($, window)
window.rule_text_popup = function(){
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="/styles/cmx.css"/>
<script src="/scripts/cmx.js"></script>
<body>
<div style="max-width:700px; -webkit-transform:rotate(1deg);">
<scene id="scene1">
<label t="translate(0,346)">
<tspan x="0" y="0em">One lazy morning</tspan>
import tornado.web
import tornado.httpserver
import tornado.ioloop
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Greetings from the instance %s!" % tornado.process.task_id())
app = tornado.web.Application([
(r"/", MainHandler),
# Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details.
"""UDP/SSL server"""
import sys
import errno
import traceback
from gevent import socket
from gevent import core
from gevent.baseserver import BaseServer
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 timger
# +Author timger
# +Gtalk&Email yishenggudou@gmail.com
# +Msn yishenggudou@msn.cn
# +Weibo @timger http://t.sina.com/zhanghaibo
# +twitter @yishenggudou http://twitter.com/yishenggudou
# Licensed under the MIT License, Version 2.0 (the "License");
[root@10.11.50.187 nginx]# cat conf/fastcgi_params
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
#fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;