Skip to content

Instantly share code, notes, and snippets.

View wiktorpyk's full-sized avatar
🐱
#boycottTalentlessFucksUsingAI

Wiktor Pyk wiktorpyk

🐱
#boycottTalentlessFucksUsingAI
View GitHub Profile
import sys
import tty
import termios
def getchar():
tattr = termios.tcgetattr(sys.stdin)
tty.setcbreak(sys.stdin.fileno(), termios.TCSANOW)
out = sys.stdin.read(1)
termios.tcsetattr(sys.stdin, termios.TCSANOW, tattr)
return out
@wiktorpyk
wiktorpyk / cat.txt
Last active December 25, 2021 09:44
|\ _,,,---,,_
/,`.-'`' -. ;-;;,_
|,4- ) )-,_..;\ ( `'-'
'---''(_/--' `-'\_)
Felix Lee <[email protected]>
@wiktorpyk
wiktorpyk / fox.png
Last active December 29, 2021 17:18
fox.png
trash/
.gitignore
* copy*
__pycache__/
target/
Cargo.lock
TOKEN.py
We couldn’t find that file to show.
@wiktorpyk
wiktorpyk / clone_gist.txt
Created February 20, 2022 19:07
How to clone a gist
git clone https://{username}:ghp_{your PAT token}@gist.github.com/{gist ID}.git
@wiktorpyk
wiktorpyk / cogs_slash_test.py
Last active September 26, 2023 20:28 — forked from 15696/cogs.py
Simple cogs example in discord.py (tested on 2.0.1)
#cogs / test.py
from discord.ext import commands
class Test(commands.Cog):
def __init__(self, client):
self.client = client
@commands.hybrid_command()
@commands.cooldown(1, 10, commands.BucketType.user)
@wiktorpyk
wiktorpyk / rsa_example.py
Created January 16, 2023 18:03
python-rsa example usage
import rsa
public, private = rsa.newkeys(512)
# private = rsa.PrivateKey.load_pkcs1(open('private.pem', mode='rb').read())
print(f"Public key: {public}")
print(f"Private key: {private}")
message = b"Hello world!"
@wiktorpyk
wiktorpyk / 1.txt
Created March 25, 2024 14:04
Training data
Egzaminator przygotował 30 pytań, wypisując na każdej kartce 4 pytania. Zdający umie odpowiedzieć poprawnie na połowę pytań. Jakie jest prawdopodobieństwo że zdający odpowie poprawnie na 4 pytania?
Rozwiązanie:
1. Oblicz |Ω|
|Ω| oznacza liczbę wszystkich możliwych wyników. W tym przypadku mamy 30 pytań, a zdający może wybrać 4 z nich. Możemy to obliczyć na dwa sposoby:
Metoda 1: Kombinacja
@wiktorpyk
wiktorpyk / Weston_backend_ABI.md
Last active April 28, 2025 23:10
Weston backend ABI

Overview

The Weston backend ABI (Application Binary Interface) defines the internal interfaces that Weston backends must implement to integrate with the core compositor. This documentation covers the key structures, functions, and protocols used by backends.

Core Structures

struct weston_backend

The main backend structure that all backends must implement. Key fields: