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
@weaming
weaming / boostnote2md.py
Last active Sep 13, 2019
Convert boostnote cson format data to markdown
View boostnote2md.py
#!/usr/bin/env python3
# coding: utf-8
"""
Author : weaming
Created Time : 2018-05-26 21:32:59
Prerequisite:
python3 -m pip install cson arrow
"""
import json
import os
View fzf_tab_binding.fish
# inspired by https://github.com/junegunn/fzf/issues/868
function __fzf_ls_files
git ls-tree -r --name-only HEAD 2>/dev/null; or fd --type f --hidden --follow --exclude .git
end
function __fzf_grep_last
set -l cmd (commandline)
# default complete all, and compatible with fzf `**<TAB>`
if str_endswith "$cmd" ' '; or test $cmd = '**'
View chrome-screenshot-by-area.js
#!/usr/bin/env node
// npm install -g puppeteer
// export NODE_PATH=$HOME/npm/lib/node_modules:$NODE_PATH
// http://screensiz.es/monitor
// https://pptr.dev/#?product=Puppeteer&version=v1.19.0&show=api-pagescreenshotoptions
// https://pptr.dev/#?product=Puppeteer&version=v1.19.0&show=api-pagesetcookiecookies
// https://github.com/GoogleChrome/puppeteer/issues/1062
// https://github.com/GoogleChrome/puppeteer/issues/669
("use strict");
View pinyin-heteronym-combination.py
import re
from pypinyin import pinyin, Style
def _recursive(a_list, b_list=None):
# a: [x] or x
if not isinstance(a_list, (list, tuple)):
a_list = [a_list]
# b: [x] or None
View ms-teams.css
/* tweak Microsoft Teams Web client style */
/* weaming */
.teams-title,
.icons-appbar-download, .app-bar-text,
#app-bar-help-button, #discover-apps-button,
#ts-waffle-button
{
display: none;
}
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 top-domains.json
[
".aaa",
".aarp",
".abarth",
".abb",
".abbott",
".abbvie",
".abc",
".abogado",
".abudhabi",
View git-handy.sh
# vim: filetype=sh
# git
alias gconf='vi .git/config'
alias gamend='git commit --amend'
alias gamendy='git commit --amend --no-edit'
alias gback='git reset --hard HEAD~'
alias gl='git lg'
function greset() {
git reset --hard "${1:-HEAD}"
View temp-mariadb-in-docker-for-test-purpose.py
"""
pip install docker mysqlclient peewee
"""
import os
import random
import time
import datetime
from playhouse.db_url import parseresult_to_dict, urlparse
import MySQLdb
View run-multiple-lines-of-shell.py
#!/usr/bin/env python3
# coding: utf-8
"""
Author : weaming
Created Time : 2019-04-24 12:41:48
"""
import subprocess
import sys
import os
You can’t perform that action at this time.