Skip to content

Instantly share code, notes, and snippets.

@Cheaterman
Cheaterman / .vimrc
Created March 11, 2025 15:37
.vimrc
set completeopt=popup,menuone
set incsearch
set modeline
set mouse=a
set omnifunc=syntaxcomplete#Complete
set scrolloff=999
set shell=/bin/bash
set showcmd
set signcolumn=yes
set tags+=,.git/tags,~/Dev/Kivy/kivy/tags
@Cheaterman
Cheaterman / utilsfile.ts
Created February 21, 2025 09:43
utils/file.ts
export function selectFile(mimeTypes: string[] = [], multiple: boolean = false) {
return new Promise<FileList | null>((resolve, reject) => {
const input = document.createElement('input')
input.type = 'file'
input.multiple = multiple
if (mimeTypes.length) {
input.accept = mimeTypes.join(', ')
}
@Cheaterman
Cheaterman / main.py
Created August 24, 2024 16:33
A radial progress bar with a gradient!
from kivy.animation import Animation
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import AliasProperty, ColorProperty, NumericProperty
from kivy.uix.effectwidget import AdvancedEffectBase, EffectWidget
class TangentGradient(AdvancedEffectBase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@Cheaterman
Cheaterman / main.py
Created April 4, 2024 18:29
main.py
import collections
import re
text = '''
20. Miguel ReC FIN 30,39 31
21. Mz FIN 30,40 29,5
21. kuiva FIN FIN 30,40 29,5
23. MozMan H K GBR 30,48 27,5
23. oizo! SWE 30,48 27,5
25. Jalli FBE NOR 30,49 25,5
@Cheaterman
Cheaterman / README.md
Last active February 26, 2025 09:04
Kivy/Cython example of GIL vs nogil thread work

Building

Use cythonize --build cysleep.pyx

Running

After building, run python main.py

@Cheaterman
Cheaterman / main.py
Created October 11, 2023 12:25
main.py
chunks = [
'He',
'llo',
', W',
'orl',
'd!\nA',
'nd h',
'ap',
'py ',
'Pyth',
@Cheaterman
Cheaterman / better_react.py
Last active September 2, 2023 18:44
Thinking in Kivy - "Thinking in React" example using Kivy
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import (
BooleanProperty,
ListProperty,
StringProperty,
)
from kivy.uix.boxlayout import BoxLayout
@Cheaterman
Cheaterman / magicmodule.py
Created August 19, 2023 16:01
magicmodule.py
import sys
class UndefinedNameLogger:
def __getattr__(self, name):
print(f'{name} not found in module {__name__}')
sys.modules[__name__] = UndefinedNameLogger()
@Cheaterman
Cheaterman / README.md
Last active July 21, 2023 20:48
Human shader in GLSL
@Cheaterman
Cheaterman / scibs.py
Last active December 2, 2022 16:58
scibs.py
import re
import httpx
from bs4 import BeautifulSoup
EMAIL = '[email protected]'
USER_AGENT = (
'Mozilla/5.0 (X11; Linux x86_64; rv:99.0) '
'Gecko/20100101 Firefox/99.0'
)