Skip to content

Instantly share code, notes, and snippets.

🍊
Focusing

garden.yuen weaming

🍊
Focusing
Block or report user

Report or block weaming

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

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 Apr 11, 2019
Tampermonkey script to define my personal key mapping using in chrome browser <3
View MyKeyMap.js
// ==UserScript==
// @name MyKepMap
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author weaming
// @match *://*/*
// @grant none
// ==/UserScript==
View caching.py
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"])
View dict-differ.py
#!/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
View img-resize.py
#!/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
View geoip.py
#!/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
View twitter-oauth.py
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)
View vimrc.vim
" vim:foldmethod=marker:foldlevel=0
" Install Plugin Manager:
" curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" The Default Config File Location Is:
" ~/.config/nvim/init.vim
" If you're using Windows 10, config file is located in:
" ~\AppData\Local\nvim\init.vim
View boostnote-issue-reproduce-example
* `loop.call_soon_threadsafe`
```python
import asyncio
import smtplib
from threading import Thread
def send_notification(email):
"""Generate and send the notification email"""
View http-echo.cr
require "http/server"
require "json"
server = HTTP::Server.new do |ctx|
req = ctx.request
body = req.body
body = body ? body.gets_to_end : ""
string = JSON.build do |json|
You can’t perform that action at this time.