Skip to content

Instantly share code, notes, and snippets.

View mythmon's full-sized avatar

Michael Cooper mythmon

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
future ideas
* rule previewer
* I am a user in CANADA I am the FOURTH user. What do I get?
Notes from meeting
* no user should get the same question twice
* this could be done on the client
* or we could just never send the payload to the same user twice, providing a set collection primitive.
* we need to record how many users take each action from the responses
* I don't know if this is our part or something in heartbeat/input
@mythmon
mythmon / brainfuck.rs
Last active April 20, 2023 23:53
A simple Brainfuck interpreter in Rust
use std::convert::Into;
use std::io::{self, Read, Bytes};
use std::str::FromStr;
fn main() {
let mut input = io::stdin().bytes();
let program = "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.";
let mut machine: BrainFuck = program.parse().unwrap();
match machine.execute_all(&mut input) {
Ok(s) => print!("{}", s),
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mythmon
mythmon / background.png
Last active October 8, 2015 20:46
Simple gulp task to cache bust image urls in css.
background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mythmon
mythmon / playground.rs
Last active August 29, 2015 14:26 — forked from anonymous/playground.rs
Shared via Rust Playground
fn main() {
type One = Succ<Zero>;
type Two = Succ<One>;
type Three = Succ<Two>;
type Five = <Two as Add<Three>>::Result;
type Four = <One as Sub<Five>>::Result;
println!("Zero: {}", Zero::fmt());
println!("One: {}", One::fmt());
println!("Two: {}", Two::fmt());
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.