Skip to content

Instantly share code, notes, and snippets.


Gilbert Wat gilbertwat

View GitHub Profile
gilbertwat /
Created March 23, 2022 09:16
Remove all Github Action Artifacts for 1 repo
echo "Removing artifacts in {$REPO} from {$ORG}"
IDS="$(gh api /repos/$ORG/$REPO/actions/artifacts --paginate --jq '.artifacts[] | .id')"
echo $IDS
if [ -z "$IDS" ];
gilbertwat /
Created May 8, 2018 00:09
How to do technical discussion?

How to do technical discussion?

  1. Define problems.
  • Define common terms:
    • What means by x ? Even when x is a common terms?
      • For example in delivery platform: What means by refund? Turns out engineering team has different definition with product team 😅
      • Save us precious time and make sure our discussion is valid
  • Define priorities (Tech Lead responsibility):
  • Is it life or death?
gilbertwat / avoid_deadlock.rb
Created March 27, 2018 09:01
Avoid Deadlock
View avoid_deadlock.rb
def must_deadlock
new_waypoints = get_new_waypoints
order.transaction do
new_waypoints.each |waypoint| do
gilbertwat / ggv_geekbot.rb
Created December 25, 2017 07:05
Geekbot API to CSV for easy analysis
View ggv_geekbot.rb
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
require 'rubygems'
require 'json'
require 'csv'
after = 1509494400 #2017-11-01 00:00:00 +0800
user_id = 'JS Console Network Tab can help you'
gilbertwat /
Last active December 13, 2017 02:42
View gist:5d6fdc1ef15de5a2643fffa8233117fd
### Keybase proof
I hereby claim:
* I am gilbertwat on github.
* I am gilbertwat ( on keybase.
* I have a public key ASD3a_S1JVXngq_gCrWIz3BIL2s1WIvsz1-tuCC39ZzGPAo
To claim this, I am signing this object:
View .tmux.conf
set-window-option -g mode-keys vi
set-option -g history-limit 3000
set -g mouse on
gilbertwat / .vimrc
Last active January 31, 2020 09:19
View .vimrc
" vim-plug stuff
call plug#begin()
" Fuzzy Search
Plug '/usr/local/opt/fzf'
" Surround open / close
Plug 'tpope/vim-surround'
" File explorer
Plug 'scrooloose/nerdtree'
gilbertwat / .zshrc
Last active June 12, 2017 07:03
zsh rc
View .zshrc
# Path to your oh-my-zsh installation.
export ZSH=/Users/gilbert/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
if [ -z $COLORTERM ]; then
gilbertwat / .gitconfig
Created April 26, 2017 01:24
View .gitconfig
d = diff
dc = diff --cached
ca = commit --amend
co = checkout
st = status
sp = stash pop
su = stash save -u
po = push origin
cm = commit -m