Skip to content

Instantly share code, notes, and snippets.

View piyonishi's full-sized avatar
On target

Yusuke Nakanishi piyonishi

On target
View GitHub Profile
form datetime import datetime
date = '2013-05-20 16:31:59.199579'
strptime = datetime.strptime(date, '%Y-%m-%d %H:%M:%S.%f')
strftime = strptime.strftime('%B %d, %Y')
import pymongo, re
regx = re.compile("^foo",re.IGNORECASE)
db.users.find({"name": regx})
def escape_html(self, var):
meta_chars = {
'"': '"',
'\'': ''',
'&': '&',
'<': '&lt;',
'>': '&gt;',
}
escaped_var = ""
for i in var: