Skip to content

Instantly share code, notes, and snippets.

@markwu
markwu / convert_itermcolors.py
Last active February 16, 2021 16:51 — forked from atav32/convert_itermcolors.py
Convert .itermcolors file to html hex & rgb
#!/usr/bin/env python
#
# Convert .itermcolors files to hex colors for html
import sys
import xml.etree.ElementTree as ET
def rgb_to_hex(rgb):
return '#%02x%02x%02x' % rgb
@markwu
markwu / test9.ahk
Created February 3, 2021 06:58 — forked from emisjerry/test9.ahk
使用AutoHotkey快速切換語言鍵盤,和超難用的Ctrl/Alt+Shift說再見!(AHK #9)
#SingleInstance Force
!1::
SetDefaultKeyboard(0x0409) ;; 切換為英文輸入
return
!2::
SetDefaultKeyboard(0x0404) ;; 切換為中文輸入
return
@markwu
markwu / script-template.sh
Created December 23, 2020 14:39 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@markwu
markwu / init.lua
Created May 27, 2020 17:48 — forked from TwoLeaves/init.lua
Hammerspoon config
--------------------------------------------------------------------------------
-- Unsupported Spaces extension. Uses private APIs but works okay.
-- (http://github.com/asmagill/hammerspoon_asm.undocumented)
spaces = require("hs._asm.undocumented.spaces")
-- Get output of a bash command
function os.capture(cmd)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
@markwu
markwu / mariadb-temporal-table.md
Created February 25, 2020 10:11 — forked from bluet/mariadb-temporal-table.md
Versioning database data with MariaDB Temporal Table

MariaDB Temporal Table

[TOC]

Description

This is a HOWTO for database record/value version control, not for schema.

With MariaDB, now we can Versioning database records (values) WITH SYSTEM VERSIONING. Once we have tables configured correctly, Data Versions will be generated automatically everytime we have new data inserted or values updated.

@markwu
markwu / plink-plonk.js
Created February 17, 2020 14:51 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@markwu
markwu / postgres-brew.md
Created August 26, 2019 17:31 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@markwu
markwu / rnb.erb
Created March 12, 2019 17:18 — forked from romainl/_rnb.md
RNB, a Vim colorscheme template
<%
# RNB, A VIM COLORSCHEME TEMPLATE
# Author: Romain Lafourcade (https://github.com/romainl)
# Canonical URL: https://gist.github.com/romainl/5cd2f4ec222805f49eca
# This template is designed to help vimmers create their own colorschemes
# without much effort.
#
# You will need Ruby to generate your colorscheme but Ruby knowledge is
# not needed at all.
@markwu
markwu / cfilter.vim
Created February 2, 2019 03:53 — forked from PeterRincker/cfilter.vim
Filter the quickfix list
" :Cfilter[!] /{pat}/
" :Cfilter[!] {pat}
" Filter the quickfix looking for pattern, `{pat}`. The pattern can match the filename or text.
" Providing `!` will invert the match (just like `grep -v`).
" Note: :cfilter command abbreviation is provided for convenience
"
" :Lfilter[!] /{pat}/
" :Lfilter[!] {pat}
" Same as :Cfilter but use the location list.
" Note: :lfilter command abbreviation is provided for convenience
@markwu
markwu / cfilter.vim
Created February 2, 2019 03:52 — forked from PeterRincker/cfilter.vim
Filter the quickfix list
" :Cfilter[!] /{pat}/
" :Cfilter[!] {pat}
" Filter the quickfix looking for pattern, `{pat}`. The pattern can match the filename or text.
" Providing `!` will invert the match (just like `grep -v`).
" Note: :cfilter command abbreviation is provided for convenience
"
" :Lfilter[!] /{pat}/
" :Lfilter[!] {pat}
" Same as :Cfilter but use the location list.
" Note: :lfilter command abbreviation is provided for convenience