Skip to content

Instantly share code, notes, and snippets.

View pnkfelix's full-sized avatar
🍩
re-pat; ex-🥐

Felix S Klock II pnkfelix

🍩
re-pat; ex-🥐
View GitHub Profile
@pnkfelix
pnkfelix / template.md
Created August 26, 2015 14:59
Template for gisted recipes.

Recipe Template

Adapted from: (URL)

  • Serves (NUMBER)
  • Time: (TIME) prep, (TIME) total

Ingredients

  • (ITEM)
@pnkfelix
pnkfelix / pork_chop_casserole.md
Created August 26, 2015 15:06
Pressure Cooker Pork Chop Casserole
// To adjust the time taken by this program, change numIters or nVertices
var numIters = 5;
var golden_output;
var PJS_P_MASK = 255;
var PJS_P_SIZE = 256;
var PJS_P = [151,160,137,91,90,15,
131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
#[warn(path_statement)]
fn main() {
let x = 3;
let boo = ();
let foo = ();
let Foo = true;
let y = if Foo { x; boo } == foo;
println!("y: {}", y);
}
trait Foo<T> { }
impl Foo<int> for () { }
fn bar<T:Send>(_t:T) { }
fn main() {
let x = ~() as ~Foo:<int>;
let y = ~() as ~Foo<int>;
println!("x: {:?} y: {:?}", x, y);
% rustc sr.rs
% ./sr
x: 3
o.seek().seek(): 4
o.reader().read(): 6
x: 6
@pnkfelix
pnkfelix / irc log
Created March 14, 2014 17:36
the way the recent irc chat has looked in felix's client
2014Mar14 18:34 <o11c> rusti: let t="Happy π day!";let s = "<"+t+">
^__^\n ü \\ (oo)\\_______\n ü (__)\\
)\\/\\\n ü ||----w |\n ü ||
||";let mut i=0u8;for l in
s.lines(){println!("{}",l.chars().map(|x|{let
s="\x03"+(i+50).to_str()+x.to_str();i=(i+1)%14;s}).to_owned_vec().concat().replace("ü","
".repeat(t.char_len())))}if true{return}
2014Mar14 18:34 -rusti- 50<51H52a53p54p55y56
57π58 59d60a61y62!63>50
51 52 53^54_55_56^
@pnkfelix
pnkfelix / l_while_x_break.svg
Last active August 29, 2015 13:57
test svg
A cut-and-pastable (but not clickable) url to view from web browser.
data:text/html,<img src="https://gist.githubusercontent.com/pnkfelix/9640892/raw/d9b421851de0c315ed8922ec7e34f07dd6cdf451/l_while_x_break.svg">
data:text/html,<img src="https://gist.githubusercontent.com/pnkfelix/9641160/raw/62a75e9d1676881b2067d2e0a2ce691399c4499c/l_loop_while_v_if_w_and_x_break_l_else_call_z.svg">
#[cfg(test)]
mod bench {
extern crate test;
use self::test::BenchHarness;
use super::{total_functional,total_oop};
#[bench]
fn bench_imp(bh: &mut BenchHarness) {
bh.iter(|| { total_oop(1000) });
}