Skip to content

Instantly share code, notes, and snippets.

Avatar
🏎️

Zheng Hao Tan tzhenghao

🏎️
View GitHub Profile
@tzhenghao
tzhenghao / .gitignore
Created Nov 22, 2015
.gitignore for Code Composer Studio projects
View .gitignore
Release/*
.xdchelp
config/*
.launches/*
@tzhenghao
tzhenghao / my.html
Created Jan 14, 2019
SQ Scammer html script
View my.html
<!DOCTYPE html>
<head>
<meta property="og:image" content="https://www.airlineratings.com/wp-content/uploads/uploads/singapore_airlines_logo-200x.jpg" />
<meta property="og:title" content="Singapore Airlines is giving away Free tickets to celebrate its 70th Anniversary" />
<script type="text/javascript" language="javascript">
var areYouReallySure = false;
var internalLink = false;
if (typeof window.orientation == 'undefined' && screen.width >= 1000){window.location.href = 'http://google.com'; areYouReallySure=true;}
@tzhenghao
tzhenghao / query_stake_account_balances.py
Created Jun 2, 2021
A Python script to query stake account balances
View query_stake_account_balances.py
"""A Python script to query stake account balances"""
import json
import requests
import subprocess
STAKE_ACCOUNT_ADDRESSES = [
"<ADD_ALL_ADDRESSES_HERE>"
]
@tzhenghao
tzhenghao / create_stake_account.py
Created Jun 2, 2021
A Python script that creates a SOL stake account and delegates it to a given validator
View create_stake_account.py
"""A Python script that creates a SOL stake account and delegates it to a given validator"""
import subprocess
LEDGER_PRIVATE_ADDR = "usb://ledger"
def main():
stake_account_json_file = input(
"Please enter the name for this new stake account: "
)
@tzhenghao
tzhenghao / disable-macos-mouse-acceleration.sh
Created Mar 18, 2018
Disable MacOS mouse acceleration
View disable-macos-mouse-acceleration.sh
#!/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
View singapore-airlines-scam-typo.js
if (wochentag==3) document.write("Wednesday");
if (wochentag==4) document.write("Thrusday");
if (wochentag==5) document.write("Friday");
@tzhenghao
tzhenghao / singapore-airlines-scam-counter-logic.js
Created Mar 17, 2019
Singapore Airlines scam counter logic
View singapore-airlines-scam-counter-logic.js
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-whatsapp-share.html
Created Mar 17, 2019
Section of the Singapore Airlines WhatsApp shareable link
View singapore-airlines-scam-whatsapp-share.html
<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-comment-area.html
Last active Mar 17, 2019
Comments section of the Singapore Airlines free ticket scam source code
View singapore-airlines-scam-comment-area.html
<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>
View singapore-airlines-scam-screen-width-redirection.js
if (typeof window.orientation == 'undefined' && screen.width >= 1000){window.location.href = 'http://google.com'; areYouReallySure=true;}