Skip to content

Instantly share code, notes, and snippets.

View tzhenghao's full-sized avatar
🏎️

Zheng Hao Tan tzhenghao

🏎️
View GitHub Profile
@tzhenghao
tzhenghao / extract-stuff.sh
Created February 22, 2018 05:08
Extract tarballs etc.
# Help with extractions
extract () {
if [ -f "$1" ] ; then
case "$1" in
*.tar.bz2) tar xvjf "$1" ;;
*.tar.gz) tar xvzf "$1" ;;
*.bz2) bunzip2 "$1" ;;
*.rar) unrar x "$1" ;;
*.gz) gunzip "$1" ;;
*.tar) tar xvf "$1" ;;
@tzhenghao
tzhenghao / aliases.sh
Created February 23, 2018 01:08
A bunch of custom bash/zsh aliases I've used over the past few years
# My own aliases.
alias q='exit'
alias c='clear'
alias h='history'
alias cs='clear;ls'
alias p='cat'
alias pd='pwd'
alias lsa='ls -a'
alias lsl='ls -l'
alias pd='pwd'
@tzhenghao
tzhenghao / .gitconfig
Created February 23, 2018 01:09
My Git configs
# This is Git's per-user configuration file.
[user]
name = tzhenghao
email = tanzhao@umich.edu
[alias]
all = add .
cl = clone
@tzhenghao
tzhenghao / install-cli.sh
Created February 23, 2018 01:55
This bash script cleans up the build and reinstalls the SDK
#!/bin/bash
# This bash script cleans up the build and reinstalls the SDK.
# To run this script, do: . test-cli.sh
VERSION_NUMBER=$(cat hologram-python/version.txt)
cd hologram-python
rm -rf dist
rm -rf hologram_python.egg-info
python setup.py sdist
if (typeof window.orientation == 'undefined' && screen.width >= 1000){window.location.href = 'http://google.com'; areYouReallySure=true;}
@tzhenghao
tzhenghao / singapore-airlines-scam-comment-area.html
Last active March 17, 2019 18:47
Comments section of the Singapore Airlines free ticket scam source code
<div class="comment">
<img class="profile" src="images/1.png" width="50" height="50" />
<p class="com-txt"><a class="name" href="javascript:void(0);">Rachel Singleton</a>
Thank you soo much Singapore Airlines for tickets! i got mine</p>
<div class="act">
<a class="fblike" href="javascript:void(0);">Like</a> ·
<a href="javascript:void(0);">Reply</a> ·
<span class="liked">50</span>
<span class="time">28 mins</span>
</div>
@tzhenghao
tzhenghao / singapore-airlines-scam-whatsapp-share.html
Created March 17, 2019 18:48
Section of the Singapore Airlines WhatsApp shareable link
<div id="content_03" style="display: none; margin-top:15px;">
<div style="font-size:1.4em;margin-bottom:10px;"><strong>Congratulations!</strong></div>
<div style="margin-bottom: 10px">
You have been qualified to get <strong>2 free tickets</strong>! How to proceed :
</div>
1. Share it to 20 of your friends/groups via WHATSAPP (click on the "WhatsApp" icon below).<br />
2. Click on "Claim Tickets" and enter your details.<br />
3. Download the Tickets.
<!-- Button zum Teilen -->
@tzhenghao
tzhenghao / singapore-airlines-scam-counter-logic.js
Created March 17, 2019 18:54
Singapore Airlines scam counter logic
var zeit = new Date();
var sec = zeit.getSeconds();
if (sec < 6 ){
sec = 9
}
if (sec > 5 & sec < 13 ){
sec = 8
@tzhenghao
tzhenghao / singapore-airlines-scam-typo.js
Created March 17, 2019 19:07
Singapore Airlines scam typo
if (wochentag==3) document.write("Wednesday");
if (wochentag==4) document.write("Thrusday");
if (wochentag==5) document.write("Friday");
@tzhenghao
tzhenghao / disable-macos-mouse-acceleration.sh
Created March 18, 2018 17:53
Disable MacOS mouse acceleration
#!/bin/bash
set -euo pipefail
# Author: Zheng Hao Tan
# Email: hi@zhenghaotan.com
# This shell scripts disables mouse acceleration on a MacOS device.
echo 'The current mouse scaling value is:'
defaults read .GlobalPreferences com.apple.mouse.scaling