Skip to content

Instantly share code, notes, and snippets.

View lordmauve's full-sized avatar
🐢
Doing some open source, slowly

Daniel Pope lordmauve

🐢
Doing some open source, slowly
View GitHub Profile
@lordmauve
lordmauve / rot13.rs
Created April 27, 2014 13:44
ROT13 stdin to stdout in Rust
use std::io;
// Get the ROT13ed equivalent of char
fn rot13(c: char) -> char {
let base = match c {
'a'..'z' => 'a' as u8,
'A'..'Z' => 'A' as u8,
_ => return c
};
@lordmauve
lordmauve / lepton 64-bit bug
Created April 17, 2013 22:31
This patch fixes a bug in lepton on 64-bit architectures makes particles go everywhere and appear in all the wrong colours.
Index: lepton/renderermodule.c
===================================================================
--- lepton/renderermodule.c (revision 247)
+++ lepton/renderermodule.c (working copy)
@@ -59,6 +59,9 @@
/* Vertex data functions and structs */
+#pragma pack(push)
+#pragma pack(4)