Skip to content

Instantly share code, notes, and snippets.

View 4sskick's full-sized avatar
🏠
Working from home

tian 4sskick

🏠
Working from home
View GitHub Profile
@4sskick
4sskick / git_large_pack_cleanup_report.md
Created October 18, 2025 18:20
Git Repository Cleanup & Large Object Reduction Report

🧠 Context

While maintaining a long-lived production repository, I noticed an unusually large .git/objects/pack file consuming hundreds of MBs.
This was affecting cloning speed, CI performance, and overall repository health.


🧪 Investigation

@4sskick
4sskick / install_python312_pyenv_wsl.md
Last active October 14, 2025 16:43
full step-by-step guide to install Python 3.12 using pyenv safely inside WSL Ubuntu 20.04, including cleanup, setup, and verification commands.

Install Python 3.12 on Ubuntu 20.04 (WSL) using pyenv

This guide provides a clean and safe method to install Python 3.12 on Ubuntu 20.04 running under WSL2, without touching the system Python.

Linux distros normally have a Python version tied to the distro and used for various admin scripts. You should not expect to follow the latest releases of Python. And don't try to force change it because you could break your OS. If you need newer Python versions for your work, install it in user space.

Linux 20.04 come with python 3.8 which not supported natively to latest version of python (ex. 3.12.x), so by using pyenv will help you install other version of python without touching OS system, and it won't break your system.


@4sskick
4sskick / check-node-modules-diff.md
Created October 10, 2025 08:02
A quick reference for detecting modified files inside node_modules after manual edits. Since Git ignores node_modules, this guide uses sha1sum (or md5sum) to track file integrity and identify which packages need patching — ideal for developers using yarn patch-package.

Detecting Changes in node_modules for Patch Package

When you edit files inside node_modules, Git does not track them --- so git status won't help detect changes.
This guide explains how to use sha1sum (or md5sum) to detect modified packages.


🧰 Check Compatibility

@4sskick
4sskick / rust_install_WSL_ubuntu.md
Last active August 18, 2025 06:26
install RUST on WSL

Rust Installation via Alternative Method

If you follow the official website, they recommend using the command:

$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

But I encountered an OpenSSL connection peer reset error.
Since that failed, I tried another way, which succeeded.

@4sskick
4sskick / Revert a.k.a Rollback on protected branch.md
Last active August 18, 2025 06:27
Local main Branch Got 19 Unexpected Commits

🐞 Git Incident Report: Local main Branch Got 19 Unexpected Commits

📅 What Happened

One morning, I had already finished developing a feature on a separate branch. Before creating a Pull Request (PR), I merged main into my feature branch to make sure everything was up to date.

After that, I switched to the main branch and ran:

git pull
@4sskick
4sskick / adb_reconnect_MEMU
Created July 10, 2025 04:41
reconnect on no devices found/emulator - MEMU emulator
if you see no listed emulator when adb devices, but the emulator already run. You can connect it through TCP by command adb connect 127.0.0.1:21503.
But this only for MEMU, because port 21503, 21504, 21505. To make sure the port running MEMU emulator, can use `netstat -aon | findstr 215`.
Will give you the listed port use on running MEMU, like
PS C:\> netstat -aon | findstr 215
TCP 0.0.0.0:21503 0.0.0.0:0 LISTENING 17000
TCP 127.0.0.1:21503 127.0.0.1:55945 ESTABLISHED 17000
TCP 127.0.0.1:55945 127.0.0.1:21503 ESTABLISHED 26792
After connect using adb connect 217.0.0.1:21503, can make sure adb device
Debounce based on https://medium.com/swlh/using-a-debounced-callback-in-react-ade57d31ca6b
@4sskick
4sskick / decode_URL_encoded
Last active May 21, 2025 08:10
parse dynamic URL encoded key value
let's say got string encoded URL like this
'pData%5B0%5D%5Bvalue%5D=&pData%5B0%5D%5Bname%5D=MultiAllowanceDetailOriginalEmployeeMultiAllowanceRecordList&pData%5B1%5D%5Bvalue%5D=MultiAllowanceDetail&pData%5B1%5D%5Bname%5D=MultiAllowanceDetailItemCode&pData%5B2%5D%5Bvalue%5D=true&pData%5B2%5D%5Bname%5D=MultiAllowanceDetailHasMultipleRecord&pData%5B3%5D%5Bvalue%5D=00000000-0000-0000-0000-000000000000&pData%5B3%5D%5Bname%5D=MultiAllowanceDetailRecordID&pData%5B4%5D%5Bvalue%5D=787b382e-bf20-f011-bad0-06d40d699a17&pData%5B4%5D%5Bname%5D=MultiAllowanceDetailParentRecordID&pData%5B5%5D%5Bvalue%5D=A&pData%5B5%5D%5Bname%5D=MultiAllowanceDetailDataChangeType&pData%5B6%5D%5Bvalue%5D=%7B%22OriginalEmployeeMultiAllowanceRecordList%22%3A%5B%7B%22RecordID%22%3A%22d524d01f-1983-e811-99c4-f430b99edb31%22%2C%22TargetRecordID%22%3A%22d524d01f-1983-e811-99c4-f430b99edb31%22%2C%22ParentRecordID%22%3A%2200000000-0000-0000-0000-000000000000%22%2C%22AllowanceCode%22%3A%22%23AR_BASC%22%2C%22DateStart%22%3A%222018-02-23T00%3A00%3A00%2
@4sskick
4sskick / delete_unwanted_suffix_name_file_of_project.md
Last active August 18, 2025 06:28
listing `unwanted` file with suffix name on path then delete

I just download the project folder from website, but it the filename being duplicate which like main.ts and main.ts.Identifier. So instead of delete one-by-one, I just listing all the file then delete directly.

  • save in sh extension

#!/bin/bash dir=${1:-.} find "dir" -type f -name "*.Identifier" -exec rm -f {} ;

  • done finish, run with command sh .sh /path/of/project
@4sskick
4sskick / share-git-on-stash.md
Created January 8, 2025 07:33
Export stash as a file, and apply it to another computer

on your active directory workspace which project you're working on, see the correct stash you wanna export to applied on another computer

Stash current changes

  • git > Stash > Stash (Include Untracked)
git stash show "stash@{index_number like: 0, 1 or 2}"

the index number would be different on your compouter, in normal situation the changes which freshly stashed will be on index 0 (zero) after sure that the file changes is correct then you're ready to write those changes on files.