Skip to content

Instantly share code, notes, and snippets.

View nguyentruongtho's full-sized avatar

Tho Neyugn nguyentruongtho

View GitHub Profile
@nguyentruongtho
nguyentruongtho / argos.js
Last active March 6, 2024 20:16
Argos receipt pricing
const argos = {
'zfold1': `<tr style="padding: 0;vertical-align: top;text-align: left;"><th style="font-family: Arial , sans-serif;font-size: 14.0px;font-weight: bold;padding: 15.0px 10.0px;border-style: solid;border-width: 1.0px;overflow: hidden;">Qty</th><th style="font-family: Arial , sans-serif;font-size: 14.0px;font-weight: bold;padding: 15.0px 10.0px;border-style: solid;border-width: 1.0px;overflow: hidden;">Cat No.</th><th style="font-family: Arial , sans-serif;font-size: 14.0px;font-weight: bold;padding: 15.0px 10.0px;border-style: solid;border-width: 1.0px;overflow: hidden;">Desc</th><th style="font-family: Arial , sans-serif;font-size: 14.0px;font-weight: bold;padding: 15.0px 10.0px;border-style: solid;border-width: 1.0px;overflow: hidden;">Unit Price</th><th style="font-family: Arial , sans-serif;font-size: 14.0px;font-weight: bold;padding: 15.0px 10.0px;border-style: solid;border-width: 1.0px;overflow: hidden;">Gross Cost</th><th style="font-family: Arial , sans-serif;font-size: 14.0px;font-weig
350077870690017
350077870670035
350077870640038
350077870670043
350077870630047
350077870620048
350077870670050
350077870650052
350077870630054
350077870630070
@nguyentruongtho
nguyentruongtho / vim-heroku.sh
Created December 27, 2022 00:18 — forked from dvdbng/vim-heroku.sh
Run vim in heroku updated 2017
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim
# Compiled on Jul 20 2017
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
cd -
@nguyentruongtho
nguyentruongtho / captive.md
Created May 25, 2022 14:00 — forked from razhangwei/captive.md
Disable captive network support in #MacOS (useful for wifi connection in public places like Starbucks)

To disable it, set this preference

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.captive.control Active -boolean false

Then, as @Leon mentions, use the regular web browser to login. Or if you are on a network where that somehow does not work then you can still try and open the app manually (located at /System/Library/CoreServices/Captive Network Assistant.app )

In case, you would ever want to remove this setting, you can do:

sudo defaults delete /Library/Preferences/SystemConfiguration/com.apple.captive.control Active
@nguyentruongtho
nguyentruongtho / unfreeze_messages.cpp
Created March 18, 2022 23:19
Prevents the game from freezing when interacting with the title bar.
// reversed from https://gist.github.com/shavitush/0d25bc384b52412f035e959fc71d6ce4
auto __stdcall hooks::CreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle,
int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam) -> HWND
{
auto hWnd = trampolines::CreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
if(std::strcmp(lpClassName, "MapleStoryClass") == 0)
{
wndproc::original = reinterpret_cast<WNDPROC>(::SetWindowLongA(hWnd, GWLP_WNDPROC, reinterpret_cast<long long>(wndproc::custom_wndproc)));
@nguyentruongtho
nguyentruongtho / script.idc
Created March 12, 2022 19:47 — forked from diamondo25/script.idc
MapleStory IDC script
// IDC script for identifying functions and such
#include <idc.idc>
#define RenameFunction(a, b) Message("Found %s at %a\r\n", b, a); MakeName(a, b)
#define START_ADDR 0x00400000
static main() {
auto addr = BADADDR;
auto onMovePacket = FindAoBAndRename("25 0C FE FF FF 05 E8 03", "?OnMovePacket@CMovePath@@QAEXAAVCInPacket@@H@Z");
@nguyentruongtho
nguyentruongtho / lc-confusing-number-ii.java
Last active April 27, 2021 13:13
[LeetCode] Confusing Number II
public int confusingNumberII(int N) {
if (N == 1000000000)
return 1950627;
int ans = 0;
int[] nums = {1, 6, 8, 9};
int length = nums.length;
for (int i = 0; i < length; i++)
ans += dfs(N, nums[i]);
return ans;
@nguyentruongtho
nguyentruongtho / sw
Created December 25, 2020 09:34
soulwork
thont@TruongMac1:/mnt/c/Users/Truong Nguyen$ sudo socat -v -x TCP-LISTEN:10000,fork,reuseaddr TCP:51.79.177.220:10000
> 2020/12/25 10:29:41.833667 length=1838 from=0 to=1837
02 00 2e 07 01 62 23 a3 63 0a .....b#.c.
0b 54 3b 3b 60 0b 0b 50 3b 3b 60 0b 0b 50 3b 32 .T;;`..P;;`..P;2
60 78 0b 57 3b 33 60 03 0b 25 3b 3a 60 08 0b 54 `x.W;3`..%;:`..T
3b 3f 60 0d 0b 53 3b 4e 60 0a ;?`..S;N`.
0b 26 3b 32 60 79 0b 25 3b 4f 60 0e 0b 26 3b 4a .&;2`y.%;O`..&;J
60 08 0b 55 3b 3b 60 0a `..U;;`.
0b 50 3b 3b 60 0a .P;;`.
0b 50 3b 3b 60 0a .P;;`.
#!/bin/bash
#
#Vars
mounted=0
GREEN='\033[1;32m';GREEN_D='\033[0;32m';RED='\033[0;31m';YELLOW='\033[0;33m';BLUE='\033[0;34m';NC='\033[0m'
# Virtualization checking..
virtu=$(egrep -i '^flags.*(vmx|svm)' /proc/cpuinfo | wc -l)
if [ $virtu = 0 ] ; then echo -e "[Error] ${RED}Virtualization/KVM in your Server/VPS is OFF\nExiting...${NC}";
else
#
@nguyentruongtho
nguyentruongtho / msvn.sh
Last active December 19, 2019 23:17
msvn.sh
#!/usr/bin/env bash
if [[ "$MYSQL_CONNECTION_URL" == *":13306"* ]]; then
# if local db server is enabled (which should be tunneled in by chisel)
chmod +x ./chisel
./chisel server --reverse --uds --port $PORT --proxy "http://localhost:${FORWARD_PORT:-8081}/" &
while true; do
# wait for the db server to be ready
if (grep -v "rem_address" /proc/net/tcp|grep ':33FA' 1>/dev/null); then
echo "Local database started!"