Skip to content

Instantly share code, notes, and snippets.

View xiexiao's full-sized avatar
🎯
Focusing

xiexiao

🎯
Focusing
  • Zhuhai
View GitHub Profile
@xiexiao
xiexiao / a extjs datefield with a clear button
Created July 25, 2014 03:40
a extjs datefield with a clear button
{
xtype: 'datefield',
onTriggerClick: function () {
var dt1 = this;
Ext.form.DateField.prototype.onTriggerClick.apply(dt1, arguments);
if (Ext.isEmpty(dt1.clearBtn)) {
this.clearBtn = new Ext.Button({
text: 'Clear',
handler: function () {
dt1.setValue("");
@xiexiao
xiexiao / a python dbhook
Last active August 29, 2015 14:04
a python dbhook
def dbhook():
'''数据库的hook'''
def _(func):
'''_'''
def wrapper(*a, **kw):
'''wrapper'''
_handler = a[0]
db = "DB/ershou.db"
_handler.conn = sqlite3.connect(db,check_same_thread = False)
_handler.conn.execute('pragma foreign_keys = on')