Skip to content

Instantly share code, notes, and snippets.

@thm1118
thm1118 / weixintool.py
Created February 5, 2015 07:12
微信创建菜单,获取二维码工具
# -*- coding: utf-8 -*-
import os
import urllib2
import time
try:
import simplejson as json
except ImportError:
import json
@thm1118
thm1118 / $exceptionHandler.js
Created January 17, 2015 14:55
angular:Catching errors with $exceptionHandler
angular.module('app', [])
.factory('$exceptionHandler', function ($injector) {
return function (exception, cause) {
var $rootScope = $injector.get('$rootScope');
$rootScope.errors = $rootScope.errors || [];
$rootScope.errors.push(exception.message);
console.log($rootScope.errors);
}
})
.run(function ($http) {
# -*- coding: utf-8 -*-
#!/usr/bin/env python
"""
THIS SCRIPT IS USED FOR EDUCATIONAL PURPOSES ONLY. DO NOT USE IT IN ILLEGAL WAY!!!
"""
import base64
from datetime import datetime
from hashlib import sha1
@thm1118
thm1118 / bulk_alter_role
Last active June 8, 2018 19:36
bulk alter role of postgreSQL's database or table or view .etc
REASSIGN OWNED BY old_role [, ...] TO new_role