Skip to content

Instantly share code, notes, and snippets.

@dmlary
dmlary / main.rs
Last active October 11, 2023 12:39
minimal example of adding a custom render pipeline in bevy 0.11
/// minimal example of adding a custom render pipeline in bevy 0.11.
///
/// When this example runs, you should only see a blue screen. There are no
/// vertex buffers, or anything else in this example. Effectively it is
/// shader-toy written in bevy.
///
/// This revision adds a post-processing node to the RenderGraph to
/// execute the shader. Thanks to @Jasmine on the bevy discord for
/// suggesting I take a second look at the bevy post-processing example
///
@joepie91
joepie91 / no-your-cryptocurrency-cannot-work.md
Last active April 13, 2024 03:21
No, your cryptocurrency cannot work

No, your cryptocurrency cannot work

Whenever the topic of Bitcoin's energy usage comes up, there's always a flood of hastily-constructed comments by people claiming that their favourite cryptocurrency isn't like Bitcoin, that their favourite cryptocurrency is energy-efficient and scalable and whatnot.

They're wrong, and are quite possibly trying to scam you. Let's look at why.

What is a cryptocurrency anyway?

There are plenty of intricate and complex articles trying to convince you that cryptocurrencies are the future. They usually heavily use jargon and vague terms, make vague promises, and generally give you a sense that there must be something there, but you always come away from them more confused than you were before.

@smunaut
smunaut / gtkwave-sigrok-filter.py
Last active January 18, 2024 18:37
Transaction Filter Process for GTKWave to run SigRok protocol decoders
#!/usr/bin/env python3
"""
gtkwave-sigrok-filter.py
Use as a 'Transaction Filter Process' in gtkwave to apply signal
Usage:
- Group input signals in gtkwave with F4
- Apply this script as a 'Transaction Filter Process' (Right click / Data Format)
import r2pipe
import os
from subprocess import run
retdec_exec = "retdec-decompiler.sh"
r2 = r2pipe.open()
filepath = r2.cmdj("ij")["core"]["file"]
@rakiru
rakiru / vxl2png.py
Last active April 19, 2017 22:04
Render an isometric overview of a VXL (AoS 0.x) map to a PNG. Improved version available here: https://gist.github.com/learn-more/7592999
# vxl2png.py: renders a vxl map isometrically
# by rakiru, 2013 - public domain
# Based on vxl2tga.py by GreaseMonkey, 2013 - public domain
# https://gist.github.com/iamgreaser/4709760
import sys, struct
import Image
if len(sys.argv) != 3:
print "Usage: %s mapfile.vxl output.png" % sys.argv[0]
(lambda n,s,I:n.classobj('h',(),dict(__init__=(lambda M,S,P,C:M.__dict__.update(
dict(R=(S,P),H=C,O=s.socket()))),C=(lambda M:(M.O.connect(M.R),setattr(M,'D',M.O
.makefile()),setattr(M,'S',(lambda l: M.O.send('%s\r\n'%l))),M.S("NICK hue"),M.S
("USER a b c d :LOL!"),setattr(M,'R',lambda n,m: M.S('PRIVMSG %s :%s'%(n,m))),M.
P())),G = (lambda M,S:S.split(' :',1)[1] if' :'in S else ''),P=(lambda M:next(I.
dropwhile((lambda Lu:((lambda L:((lambda: M.S("PONG :%s"%M.G(L))if L.startswith(
'PING')else(lambda P,G,S:({'001':(lambda: M.S('JOIN %s'%M.H)),'PRIVMSG':(lambda:
M.HC(L[1:].split('!',1),P[2],G[1:].split(),G)if G.startswith('!')else None)}.get
(P[1],lambda: None)())if len(P)>1 else None)(L.split(),M.G(L),M.O))()))(Lu.strip
()),True)[1]),iter(M.D)),None)),HC=(lambda M,(N,H),C,P,L: {'hello':lambda:M.R(C,