Skip to content

Instantly share code, notes, and snippets.

View WillyJL's full-sized avatar
🗿

WillyJL WillyJL

🗿
View GitHub Profile
@WillyJL
WillyJL / ziparch.py
Last active January 25, 2025 21:32
Deterministic zip archiving for Python
import os
import pathlib
import zipfile
ZIP_COMPRESS_TYPE = zipfile.ZIP_DEFLATED
ZIP_ARCH_EXTENSION = ".zip"
def zip_sanitizer_filter(zipinfo: zipfile.ZipInfo):
@WillyJL
WillyJL / proxitok.js
Last active February 26, 2023 23:40
Userscript to redirect tiktok.com to proxitok
// ==UserScript==
// @name Proxitok
// @match https://www.tiktok.com/*
// @grant none
// @version 1.0
// @run-at document-start
// @author WillyJL
// @description Redirect tiktok.com to proxitok
// ==/UserScript==
@WillyJL
WillyJL / pyimgui_scrolling.py
Last active May 17, 2022 07:28
Smooth scrolling and scroll multiplier for pyimgui
from imgui.integrations.glfw import GlfwRenderer
import OpenGL.GL as gl
import imgui
import glfw
# Example usage
if __name__ == "__main__":
imgui.create_context()
window = impl_glfw_init() # Get this here https://github.com/pyimgui/pyimgui/blob/24219a8d4338b6e197fa22af97f5f06d3b1fe9f7/doc/examples/integrations_glfw3.py
@WillyJL
WillyJL / pyimgui_ratingwidget.py
Last active November 19, 2022 03:43
Simple rating widget for pyimgui
import imgui
filled_icon = "󰓎"
empty_icon = "󰓒"
def ratingwidget(id: str, current: int, num_stars=5, *args, **kwargs):
value = current
imgui.push_style_color(imgui.COLOR_BUTTON, 0, 0, 0, 0)
imgui.push_style_color(imgui.COLOR_BUTTON_ACTIVE, 0, 0, 0, 0)
@WillyJL
WillyJL / async_thread.py
Last active November 11, 2024 14:03
Python thread to run coroutines in a separate asynchronous context
import threading
import asyncio
import typing
import time
loop: asyncio.BaseEventLoop = None
thread: threading.Thread = None
done_callback: typing.Callable = None
@WillyJL
WillyJL / sync_thread.py
Last active May 16, 2022 16:58
Python thread to run functions in a queue
import queue as _queue
import threading
import typing
import time
fn_queue: _queue.Queue = None
thread: threading.Thread = None
def setup():
@WillyJL
WillyJL / pyimgui_imagehelper.py
Last active July 5, 2023 10:08
Image helper class for pyimgui
from PIL import Image, ImageSequence, UnidentifiedImageError
import OpenGL.GL as gl
import pathlib
import imgui
_dummy_texture_id = None
def dummy_texture_id():
global _dummy_texture_id
@WillyJL
WillyJL / pyimgui_filepicker.py
Last active February 25, 2024 05:51
Simple file picker widget for pyimgui
import pathlib
import typing
import string
import imgui
import sys
import os
dir_icon = "[D] " # Use "󰉋 " if you have setup Material Design Icons
file_icon = "[F] " # Use "󰈔 " if you have setup Material Design Icons
up_icon = "Go Up" # Use "󰁞" if you have setup Material Design Icons
@WillyJL
WillyJL / pyimgui_aiohttp_example.py
Last active March 27, 2022 17:39
PyImGui + Aiohttp example, with main sync thread for window and second thread for asyncio
from imgui.integrations.glfw import GlfwRenderer
import OpenGL.GL as gl
import traceback
import threading
import asyncio
import aiohttp
import imgui
import glfw
import sys
@WillyJL
WillyJL / 🧩 Code::Stats Levels
Last active June 30, 2025 09:28
🧩 Code::Stats Levels
Total XP lvl 26 (1,140,583 XP)
C lvl 17 ( 496,910 XP)
Python lvl 13 ( 313,180 XP)
Markdown lvl 9 ( 130,677 XP)
C++ lvl 6 ( 69,055 XP)
JavaScript lvl 3 ( 24,127 XP)
meson lvl 3 ( 18,466 XP)
Vue lvl 3 ( 18,024 XP)
Shell Script lvl 2 ( 13,352 XP)
CMake lvl 2 ( 11,524 XP)