Skip to content

Instantly share code, notes, and snippets.

View xiongnemo's full-sized avatar
🧧

Nemo Xiong xiongnemo

🧧
View GitHub Profile
import code
from guppy import hpy
def show_memory_stat():
print("===== GC Count (0th, 1st, 2rd Gen) =====")
print(gc.get_count())
h = hpy()
heap = h.heap()
print("===== Heap =====")
print(heap)
print("===== Heap by Type =====")
@xiongnemo
xiongnemo / brush.sh
Created November 7, 2022 08:19
Boot logo updater script for A12 (MIUI 13) Poco F3/Mi11x/Redmi K40 (codename alioth/aliothin)
# https://forum.xda-developers.com/t/custom-boot-splash-logo-custom-boot-animation-for-poco-f3.4337783/post-86692213
fastboot flash uefisecapp_a uefisecapp.img
fastboot flash uefisecapp_b uefisecapp.img
fastboot flash xbl_a xbl.img
fastboot flash xbl_b xbl.img
fastboot flash xbl_config_a xbl_config.img
fastboot flash xbl_config_b xbl_config.img
fastboot flash logo logo.img
@xiongnemo
xiongnemo / chrome_copy_curl_to_py.py
Created July 22, 2023 08:24
Transform "Copy as cURL (bash)" text to request session.
headers = {}
post_flag = False
data_flag = False
data = None
print('Provide your raw "Copy as cURL (bash)" with preceding whitespaces below:\n')
while True:
a = input()
if a.startswith('curl'):
url = a.lstrip('curl').rstrip('\\').strip().strip("'")
continue
@xiongnemo
xiongnemo / nginx-autolist.conf
Created January 24, 2024 07:34
Nginx autolist module + json
# docker run -p 65535:80 -v <?>:/nginx -v nginx-autolist.conf:/etc/nginx/conf.d/autolist.conf nginx
autoindex on;
autoindex_format json;
server {
listen 80;
server_name 127.0.0.1;
root /nginx;