View kanye-anime.csv
User Kanye Anime Comment
SufjanStevens Late Registration good
joaquin 808s bad
pedroteixeira MBDTF good
Tahloolah MBDTF good
ligeti MBDTF N/A Q2) My Beautiful Dark Twisted Fantasy
Ziven001 Yeezus good
CrimeFuck College Dropout good
shaded_fox Late Registration good
Cian 808s good
View philosophers.c
/* Compile as gcc philosophers.c -pthread */
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
pthread_mutex_t fork_ = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t knife = PTHREAD_MUTEX_INITIALIZER;
void *socrates(void *nothing) {
View driverstation.html
<html>
<head>
<meta charset="utf8"/>
<title>Driver Station</title>
</head>
<body>
<img src="http://10.10.76.17:5807/?action=stream" width="480" height="360" class="flip"/>
<img src="http://10.10.76.19:5809/?action=stream" width="480" height="360" class="flip"/>
<style>.flip { transform: rotate(180deg); }</style>
</body>
View mandelbrot.laz
(let! *width* 128)
(let! *height* 128)
(struct cplx
real imag)
(let! real cplx/real)
(let! imag cplx/imag)
(defn (c/+ a b)
View exception.c
#include <iso646.h>
#include <setjmp.h>
#include <stdio.h>
// Exception Macros
int _exn_handler_idx = 0;
jmp_buf _exn_handlers[1024];
View conformant_json_parser.py
# RFC 7159 § 9
# "An implementation may set limits on the size of texts that it accepts."
def parse_json(text):
if len(text) != 1:
raise ValueError("Only accepts single character JSON values")
return int(text[0])
View keybase.md

Keybase proof

I hereby claim:

  • I am porglezomp on github.
  • I am porglezomp (https://keybase.io/porglezomp) on keybase.
  • I have a public key ASBz_m2oruQIDIMJM-2Sg8gOiGO0o8uCWbG1hP-ti7F4_wo

To claim this, I am signing this object:

View README.md

Serializing Binary Data in Rust

The way I like to serialize data in Rust into binary formats is to let a data structure blit itself into a mutable buffer. This is a relatively composable, low level way to work that lends itself to having other abstractions built on top of it. I recently was serializing network packets, so let's make up a small packet format that illustrates how we can do this.

+-------------+-------------+
|  Tag (u16)  | Count (u16) |
+-------------+-------------+
|                           |
~        Entry (u32)        ~
View parsable_enum.rs
macro_rules! parsable_enum {
($(#[$attrs:meta])* enum $name:ident { $($member:ident),*}) =>
(parsable_enum! { $(#[$attrs])* enum $name { $($member),* ,}});
($(#[$attrs:meta])* enum $name:ident { $($member:ident),* , }) => {
$(#[$attrs])*
pub enum $name {
$($member),+
}
use std::str::FromStr;
View fib.em
fib ^n = {
fib ^n ^a ^b = {
if (n <= 0) ^!( return a )
if (n == 1) ^!( return b )
fib (n - 1) b (a + b)
}
fib n 0 1
}