Skip to content

Instantly share code, notes, and snippets.

@saik0
saik0 / cmap.clj
Last active August 29, 2015 14:19
Cumulative map
(defn cmap
"lazy cumulative map"
([f coll] (cmap f (f) coll))
([f val coll]
(cons val
(if (empty? coll)
nil
(lazy-seq (cmap f
(f val (first coll))
(rest coll))))))
@saik0
saik0 / keybase.md
Created July 24, 2015 02:34
Keybase Proof

Keybase proof

I hereby claim:

  • I am saik0 on github.
  • I am joelpedraza (https://keybase.io/joelpedraza) on keybase.
  • I have a public key whose fingerprint is 46E4 E501 0F1A 56F4 8235 9512 A092 F38E A440 C589

To claim this, I am signing this object:

@saik0
saik0 / gol.rs
Last active January 25, 2017 22:39
fn on_render(&mut self, window: &mut PistonWindow, ren: RenderArgs, e: Event) {
let fps = self.fps_counter.tick();
let ref front = self.front;
window.draw_2d(&e, |c, g| {
let rect = Rectangle::new(color::BLACK);
clear(color::WHITE, g);
let mut i = 0;
let mut bounds = [0.0, 0.0, SIZE, SIZE];