This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A dynamic class mixer.""" | |
__author__ = "Andy Dustman <[email protected]>" | |
__revision__ = "$Revision: 1.5 $"[11:-2] | |
import types | |
import new | |
if hasattr(types, 'ObjectType'): | |
classobj = type | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The Pool module provides some classes for managing a fixed-size thread-safe pool of functionally identical objects. One use for this is database connections, which tend to take awhile to create. | |
Pool | |
class that manages the pool of objects. | |
Constructor | |
class used to create new instances of items in the Pool. | |
For more details, use pydoc or read the docstrings in the code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Copyright 2009 Facebook | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 网页简繁体转换 | |
// 本js用于客户在网站页面选择繁体中文或简体中文显示,默认是正常显示,即简繁体同时显示 | |
// 在用户第一次访问网页时,会自动检测客户端语言进行操作并提示.此功能可关闭 | |
// 本程序只在UTF8编码下测试过,不保证其他编码有效 | |
// -------------- 以下参数大部分可以更改 -------------------- | |
//s = simplified 简体中文 t = traditional 繁体中文 n = normal 正常显示 | |
var zh_default = 'n'; //默认语言,请不要改变 | |
var zh_choose = 'n'; //当前选择 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# post_commit and post_rollback transaction signals for Django with monkey patching | |
# Author Grégoire Cachet <[email protected]> | |
# http://gist.github.com/247844 | |
# | |
# Usage: | |
# You have to make sure to load this before you use signals. | |
# For example, create utils/__init__.py and then utils/transaction.py contening | |
# this gist in you project. Then add "import utils.transaction" in your project | |
# __init__.py file | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# memcached: MemCached Daemon | |
# | |
# chkconfig: - 90 25 | |
# description: MemCached Daemon | |
# | |
### BEGIN INIT INFO | |
# Provides: memcached | |
# Required-Start: $syslog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# nginx - this script starts and stops the nginx daemin | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /usr/local/nginx/conf/nginx.conf | |
# pidfile: /usr/local/nginx/logs/nginx.pid |
NewerOlder