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
:w sudo su tee % |
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
ssh user@host 'mkdir ~/.ssh;echo '`cat ~/.ssh/id_dsa.pub`' >> ~/.ssh/authorized_keys' |
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
def require_login(func): | |
def require_login_wrapper(self): | |
self.user = users.get_current_user() | |
if self.user is None: | |
self.redirect(users.create_login_url(self.request.path_info + | |
'?' + self.request.query_string)) | |
return | |
func(self) | |
return require_login_wrapper |
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
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages | |
try: | |
__import__('pkg_resources').declare_namespace(__name__) | |
except ImportError: | |
from pkgutil import extend_path | |
__path__ = extend_path(__path__, __name__) |
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/python setup.py deploy |
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/paster create -t pyramid_routesalchemy pyramid001 |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title>倒计时</title> | |
<script type="text/javascript"> | |
// Default settings: 5 minutes, warning at 1 minute | |
var count = 5 * 60; | |
var warning = 60; | |
function $(id){ return document.getElementById(id)} |
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
## {{{ http://code.activestate.com/recipes/440627/ (r1) | |
'''code_module.py | |
The purpose of this module | |
is to provide functions | |
for the coding of strings. | |
This is a level 1 module.''' | |
#================================== |
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
在genshi中的表达式中需要用html转义字符> <表示大于和小于符号 | |
例如 | |
<br py:if="len(items) < 4" class="clear" /> |
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
require 'formula' | |
<<-COMMENTS | |
Versions | |
-------- | |
This formula is currently tracking version 2.6.x. | |
Python 3.x is available as a separate formula: | |
brew install python3 |