Skip to content

Instantly share code, notes, and snippets.

View tzhenghao's full-sized avatar
🏎️

Zheng Hao Tan tzhenghao

🏎️
View GitHub Profile
@tzhenghao
tzhenghao / query_stake_account_balances.py
Created June 2, 2021 07:35
A Python script to query stake account balances
"""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 June 2, 2021 07:33
A Python script that creates a SOL stake account and delegates it to a given validator
"""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 / 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 / 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-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-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>
if (typeof window.orientation == 'undefined' && screen.width >= 1000){window.location.href = 'http://google.com'; areYouReallySure=true;}
@tzhenghao
tzhenghao / my.html
Created January 14, 2019 03:14
SQ Scammer html script
<!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 / 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: [email protected]
# This shell scripts disables mouse acceleration on a MacOS device.
echo 'The current mouse scaling value is:'
defaults read .GlobalPreferences com.apple.mouse.scaling
@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