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()
-- From https://codepad.co/snippet/hammerspoon-init-lua
-------------------------------------------------------------------
--Hammerspoon config to replace Cinch & Size-up (Microsoft Windows style) window management for free
--By Jayden Pearse (spartanatreyu)
--Sort of messy, forgive me. Never scripted in lua before
-------------------------------------------------------------------
-------------------------------------------------------------------
@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
configure: WARNING: unrecognized options: --with-sodium
configure: creating cache /Users/mark/.phpbrew/cache/config.cache
./configure: line 3188: /Users/mark/.phpbrew/cache/config.cache: No such file or directory
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking build system type... x86_64-apple-darwin18.7.0
checking host system type... x86_64-apple-darwin18.7.0
checking target system type... x86_64-apple-darwin18.7.0
checking for cc... cc
@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
$ sudo pacman -S fcitx fcitx-chewing kcm-fcitx
#fcitx
export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx