Skip to content

Instantly share code, notes, and snippets.

"""
This pure-python ChaCha20 implementation reaches 32MiB/sec on my machine (M1 Pro)
otoh, cryptography.io's impl reaches about 1700MiB/s. Way faster, of course, but only about 50x faster.
This is code is a proof-of-concept and should not be used in a security context.
"""
CONST_MAGIC = b"expand 32-byte k"
CONST_WORDS = [int.from_bytes(CONST_MAGIC[i:i+4], "little") for i in range(0, 16, 4)]
@coolreader18
coolreader18 / segfault.py
Last active March 30, 2024 08:05
CPython segfault in 5 lines of code
class E(BaseException):
def __new__(cls, *args, **kwargs):
return cls
def a(): yield
a().throw(E)
@gregopet
gregopet / Jooq.java
Created November 1, 2019 20:23
jOOQ plain SQL examples
jooq.fetchOne("select * from film limit 1");
// type safety for fields
jooq.fetchOne("select * from film limit 1").get(FILM.TITLE);
jooq.fetchOne("select title || ' ' || description from film limit 1").get(0, String.class);
// parameters
jooq
.fetchOne("select title || ' ' || description from film where title like ? limit 1", "DINOSAUR%")
.get(0, String.class);
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active June 29, 2024 18:18
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@Lukasa
Lukasa / netlink_ifnew.py
Created March 4, 2015 09:26
Monitor for new links using Python and Netlink
@staltz
staltz / introrx.md
Last active June 29, 2024 15:58
The introduction to Reactive Programming you've been missing
@rxaviers
rxaviers / gist:7360908
Last active June 29, 2024 18:36
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: