Skip to content

Instantly share code, notes, and snippets.

View wongjiahau's full-sized avatar

WJH wongjiahau

  • Malaysia
View GitHub Profile
  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug

Most of the time when I do this I checkout to a temp branch:

> git checkout -b temp-branch-name ea3d5ed039edd6d4a07cc41bd09eb58edd1f2b3a

Then after I'm done i just delete the branch

@wongjiahau
wongjiahau / Vim mnemonics and keys
Last active August 13, 2017 12:24
List of useful mnemonics for vim
W //go to next Word (separated by space)
B //Back to previous Word (separated by space)
dib //Delete inside bracket
daw //Delete a word
dtk //Delete 'till 'k'
cW //Change big word (until a whitespace is reached)
cw //Change small word (until any non-alphabet is reached)
<Ctrl-a> //Add the first number in the current line by 1
<Ctrl-x> //Xubtract the first number in the current line by 1
180<Ctrl-a> //Add the first number in the current line by 180
@wongjiahau
wongjiahau / script.sh
Created August 12, 2017 05:06 — forked from thimbl/script.sh
shell script to create user accounts
#!/bin/bash
ROOT_UID=0
SUCCESS=0
E_USEREXISTS=70
# Run as root, of course. (this might not be necessary, because we have to run the script somehow with root anyway)
if [ "$UID" -ne "$ROOT_UID" ]
then
echo "Must be root to run this script."
exit $E_NOTROOT
git config --global http.proxy http://1500181:960619-43-5357@proxy2.utar.edu.my:8080
#Delete last commit at remote (e.g. GitHub)
git push -f origin HEAD^:master
#Delete a particular commit at local git
git reset --hard <sha1-commit-id>
#Deleting last commit locally (HEAD~1 means last commit)
git reset --hard HEAD~1
@wongjiahau
wongjiahau / cloudSettings
Last active June 2, 2021 05:47
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-06-02T05:47:46.849Z","extensionVersion":"v3.4.3"}
rem rem stands for remark/comments
rem Kill all chrome process
taskkill /F /IM chrome.exe
rem Start chrome by disabling CORS
start chrome --disable-web-security --user-data-dir
@wongjiahau
wongjiahau / gist:4c4c9ac09d259edb1a3bd4ea167a5eeb
Last active October 13, 2017 07:01
Run a new instance of Chrome that disabled CORS/XSS protection
# For Windows
start chrome.exe --user-data-dir="C:/chrome-dev-session" --disable-web-security www.github.com
# For Linux
# not known yet
# For Mac
# not known yet
@wongjiahau
wongjiahau / gist:557defb6dfeff811cc446759bd11f536
Last active October 15, 2017 14:53
My gitconfig file (gitrc)
[http]
sslCAInfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
[diff "astextplain"]
textconv = astextplain
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %
required = true
process = git-lfs filter-process
[credential]