Skip to content

Instantly share code, notes, and snippets.

View Willy-JL's full-sized avatar
🗿

WillyJL Willy-JL

🗿
View GitHub Profile
@Willy-JL
Willy-JL / ziparch.py
Last active September 8, 2024 00:14
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):
@Willy-JL
Willy-JL / 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==
@Willy-JL
Willy-JL / 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
@Willy-JL
Willy-JL / 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)
@Willy-JL
Willy-JL / 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
@Willy-JL
Willy-JL / 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():
@Willy-JL
Willy-JL / 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
@Willy-JL
Willy-JL / 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
@Willy-JL
Willy-JL / 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
@Willy-JL
Willy-JL / 🧩 Code::Stats Levels
Last active November 27, 2024 03:24
🧩 Code::Stats Levels
Total XP lvl 19 ( 630,237 XP)
C lvl 12 ( 258,524 XP)
Python lvl 11 ( 196,291 XP)
Markdown lvl 6 ( 72,703 XP)
JavaScript lvl 3 ( 23,308 XP)
Vue lvl 3 ( 18,024 XP)
C++ lvl 2 ( 13,534 XP)
Shell Script lvl 2 ( 12,704 XP)
TypeScript lvl 2 ( 9,490 XP)
JSON lvl 1 ( 5,687 XP)