Skip to content

Instantly share code, notes, and snippets.

View baseplate-admin's full-sized avatar

baseplate-admin

  • GlitchGalore
  • Middle of Nowhere
View GitHub Profile
@JulienPradet
JulienPradet / Component.svelte
Last active February 5, 2025 23:17
How to use `use` directive to trap focus in Svelte
<script>
import {trapFocus} from "./trapFocus";
</script>
<div use:trapFocus>
<button>Hi!</button>
<button>Second button</button>
</div>
@Guhan-SenSam
Guhan-SenSam / 1info.md
Last active June 7, 2025 12:07
Methods to Optimizing Kivy Performance

Many people state that kivy is slow. While this may be true it is mostly due to that python is slow to run on android devices.Thus it is in the programmer's hands to properly optimize their code so as to create a performant application.

Most of the lag on android devices runing kivy apps arise due to widget creation. Widget creation remains the slowest step in a kivy app. Here are some of the methods that I follow to optimize my apps and ensure I can hit 60fps even on old devices

Optimization Methods:

@meicookies
meicookies / weeaboo.lol
Created June 21, 2021 20:47
Wibu Stress Generator written in LOLCODE
HAI 1.2
OBTW
CODED BY ./MEICOOKIES
TLDR
O HAI IM WEEB
HOW IZ I SEX YR WAIFU AN YR CUM
CUM, WTF?
OMG "1"
@wzjoriv
wzjoriv / clustering.py
Last active March 18, 2026 15:51
Nearest Neighbor, K Nearest Neighbor and K Means (NN, KNN, KMeans) implemented only using PyTorch
import torch as th
"""
Author: Josue N Rivera (github.com/wzjoriv)
Date: 7/3/2021
Description: Snippet of various clustering implementations only using PyTorch
Full project repository: https://github.com/wzjoriv/Lign (A graph deep learning framework that works alongside PyTorch)
"""
def random_sample(tensor, k):
@J-Priebe
J-Priebe / jwt_middleware.py
Last active November 8, 2025 09:36
Cookie-based JWT Middleware for Django Channels
from django.contrib.auth.models import AnonymousUser
from django.db import close_old_connections
from django.conf import settings
from channels.sessions import CookieMiddleware
from channels.db import database_sync_to_async
from rest_framework_simplejwt.authentication import JWTAuthentication
import logging
logger = logging.getLogger(__name__)