Skip to content

Instantly share code, notes, and snippets.

View weaming's full-sized avatar
🦀
Rustacean

Garden Yuen weaming

🦀
Rustacean
  • Shenzhen, China
View GitHub Profile
@weaming
weaming / sqlfmt.py
Created April 18, 2019 09:11
Format `mysqldump` sql file into editable style.
#!/usr/bin/env python3
# coding: utf-8
"""
Author : weaming
Created Time : 2019-04-18 15:18:31
"""
import sys
import argparse
"""
pip install docker mysqlclient peewee
"""
import os
import random
import time
import datetime
from playhouse.db_url import parseresult_to_dict, urlparse
import MySQLdb
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory as ~/.spacemacs
;; Use "SPC f e d" to open it
;; TODO:
;; change temp file directory
;; show code tree
;; open file in new window when searching recent files
;; open file in special window when navigate in file tree

Keybase proof

I hereby claim:

  • I am weaming on github.
  • I am weaming (https://keybase.io/weaming) on keybase.
  • I have a public key ASAVXvq5MKcxCiNGC81R5rF02aW4IaoBRgh3GrbRC-ufswo

To claim this, I am signing this object:

@weaming
weaming / MyKeyMap.js
Last active April 11, 2019 15:44
Tampermonkey script to define my personal key mapping using in chrome browser <3
// ==UserScript==
// @name MyKepMap
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author weaming
// @match *://*/*
// @grant none
// ==/UserScript==
import time
import os
import hashlib
from threading import Lock
from collections import namedtuple
from project.settings import BASE_DIR, CACHE_IMAGE_MAXSIZE, CACHE_IMAGE_TTL
CacheValue = namedtuple("CacheValue", ["ts", "value"])
#!/usr/bin/env python3
# coding: utf-8
"""
Author : weaming
Created Time : 2019-01-17 14:34:26
"""
import os
import sys
import json
import argparse
#!/usr/bin/env python3
# coding: utf-8
"""
Author : weaming
Created Time : 2019-01-12 12:27:02
"""
import sys
import os
from io import BytesIO
from PIL import Image
#!/usr/bin/env python3
# coding: utf-8
"""
Author : weaming
Created Time : 2019-01-07 17:10:31
pip3 install requests jsonkv
"""
import os
import time
import argparse
from oauthlib.common import urldecode
from requests_oauthlib import OAuth1Session, OAuth1
from django.db import models
from maid.models.base.model import ModelDateTimeMixin, ModelHelperMixin
from maid.utils import generate_uuid4
class OAuth(ModelDateTimeMixin, ModelHelperMixin):
uuid = models.CharField(max_length=36, primary_key=True, default=generate_uuid4)
client_key = models.CharField(max_length=128)