This file contains 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/python | |
""" | |
Connect to an IMAP4 server with Twisted. | |
--------------------------------------- | |
Run like so: | |
$ python twisted_imap4_example.py | |
This example is slightly Gmail specific, | |
in that SSL is required, and the correct | |
server name and ports are set for Gmail. |
This file contains 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/perl -w | |
# | |
# This script was developed by Robin Barker ([email protected]), | |
# from Larry Wall's original script eg/rename from the perl source. | |
# | |
# This script is free software; you can redistribute it and/or modify it | |
# under the same terms as Perl itself. | |
# | |
# Larry(?)'s RCS header: | |
# RCSfile: rename,v Revision: 4.1 Date: 92/08/07 17:20:30 |
This file contains 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 | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" | |
This file contains 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
#import <Foundation/Foundation.h> | |
int main(int argc, const char *argv[]) | |
{ | |
//comment added. | |
NSLog(@"Hello, Objective-C!"); | |
return (0); | |
}//main |
This file contains 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
import os | |
import re | |
import glob | |
def initdb(base=os.getcwd(), ext="*.db3"): | |
'''get db file list, | |
use current directory as base, | |
and db3 as extention | |
''' | |
try: |
This file contains 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
import time | |
import os | |
os.environ['TZ']='Asia/Shanghai' | |
time.tzset() |
This file contains 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
//add unique function to Array | |
Array.prototype.unique = function() { | |
var o = {}, i, l = this.length, r = []; | |
for(i=0; i<l;i++) o[this[i]] = this[i]; | |
for(i in o) r.push(o[i]); | |
return r; | |
}; | |
//usage: | |
// a = "a a bb"; | |
// a =a.split(" "); |
This file contains 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
from django.conf.urls.defaults import * | |
from django.http import HttpResponse | |
''' | |
if required, please add the last 2 lines to settings.py: | |
MIDDLEWARE_CLASSES = ( | |
'django.middleware.common.CommonMiddleware', | |
'django.contrib.sessions.middleware.SessionMiddleware', | |
# 'django.middleware.csrf.CsrfViewMiddleware', | |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
This file contains 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
<html> | |
<body> | |
<h4>Cell that spans two columns:</h4> | |
<table border="1"> | |
<tr> | |
<th>Name</th> | |
<th colspan="2">Telephone</th> | |
</tr> | |
<tr> |
This file contains 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/python | |
# -*- coding: utf-8 -*- | |
# | |
#author: rex | |
#blog: http://iregex.org | |
#filename dictregex.py | |
#created: 2010-12-27 14:27 | |
import re |
OlderNewer