Skip to content

Instantly share code, notes, and snippets.

View coolreader18's full-sized avatar

Noa coolreader18

View GitHub Profile
rustpython_vm::frame::ExecutingFrame::run:
push rbp
push r15
push r14
push r13
push r12
push rbx
sub rsp, 216
mov r14, rdx
mov r15, rsi
rustpython_vm::frame::ExecutingFrame::execute_instruction:
push rbp
push r15
push r14
push r13
push r12
push rbx
sub rsp, 600
mov r12, rdx
mov rbp, rsi
#include <IRremote.h>
const int RECV_PIN = 7, LED_PIN = 3;
IRrecv irrecv(RECV_PIN);
decode_results results;
unsigned long key_value = 0;
void setup() {
Serial.begin(9600);
import a
import functools
ready = object()
go = object()
def run(coro, *, payload=None, error=False):
send = coro.throw if error else coro.send
use rand;
use rand_core;
use rand::Rng;
/*
A C-program for MT19937, with initialization improved 2002/1/26.
Coded by Takuji Nishimura and Makoto Matsumoto.
Before using, initialize the state by using init_genrand(seed)
@coolreader18
coolreader18 / segfault.py
Last active March 15, 2026 08:04
CPython segfault in 5 lines of code
class E(BaseException):
def __new__(cls, *args, **kwargs):
return cls
def a(): yield
a().throw(E)
#!/usr/bin/env python3
import PIL.Image
from PIL import ImageSequence
import wand.image
from io import BytesIO, RawIOBase
def gmagik(gif: PIL.Image.Image, out: RawIOBase):
total = gif.n_frames
@coolreader18
coolreader18 / odt2md.sh
Last active July 26, 2019 18:24
Convert a LibreOffice ODT file to a Hugo post.
#!/bin/bash
set -e
case $# in
0)
file=$(
zenity --file-selection \
--file-filter='*.odt' --file-filter='*.docx' --file-filter='*.*' \
--title "Select a document to publish:" \
2>/dev/null
This file has been truncated, but you can view the full file.
{"$schema":"https://www.speedscope.app/file-format-schema.json","profiles":[{"type":"evented","name":"RustPython main","unit":"nanoseconds","startValue":399,"endValue":53408720,"events":[{"type":"O","at":113364,"frame":0},{"type":"O","at":117875,"frame":1},{"type":"C","at":564580,"frame":1},{"type":"C","at":2547506,"frame":0},{"type":"O","at":2548124,"frame":2},{"type":"O","at":3372050,"frame":3},{"type":"O","at":3395560,"frame":4},{"type":"C","at":3399468,"frame":4},{"type":"O","at":3400019,"frame":5},{"type":"C","at":3400536,"frame":5},{"type":"O","at":3401015,"frame":6},{"type":"C","at":3401211,"frame":6},{"type":"O","at":3402361,"frame":7},{"type":"C","at":3432454,"frame":7},{"type":"O","at":3434631,"frame":8},{"type":"C","at":3438657,"frame":8},{"type":"O","at":3439454,"frame":9},{"type":"C","at":3439965,"frame":9},{"type":"O","at":3440829,"frame":10},{"type":"C","at":3460624,"frame":10},{"type":"O","at":3461106,"frame":11},{"type":"C","at":3461453,"frame":11},{"type":"O","at":3463211,"frame":12},{"type"
This file has been truncated, but you can view the full file.
<!doctype html>
<html>
<head>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;