Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Component.extend({
value: null,
actions: {
change(e) {
return True;
}
}
});
# relevant code is at https://github.com/orestis/adventofcode/blob/master/2016/day11/lib/day11.ex
$ elixir -pa _build/MIX_ENV/consolidated -S mix profile.fprof --callers -e "Day11.solve"
...
<snip>
...
End of trace!
Processing data...
Creating output...
@orestis
orestis / iterate.clj
Last active January 2, 2018 16:39
Elixir Streams in Clojure
;; Stream.iterate(0, &(&1 + 1))
;; |> Enum.take(5)
;; gives us [0, 1, 2, 3, 4]
(take 5 (iterate #(+ % 1) 0))
;; => (0 1 2 3 4)
;; Mandelbrot
;; defmodule Mandelbrot do
(ns scratch
(:require [clojure.string :as str]))
(defn csv-split [line]
(str/split line #","))
(defn replace-col [cols idx s]
(map-indexed (fn [i x] (if (= i idx) s x)) cols))
(defn index-of [coll value]
(ns hooks-store
(:require ["react" :as react]
["react-dom" :as react-dom]))
(defprotocol IStore
(-trigger-subs [this old-state new-state])
(-get-value [this selector])
(destroy [this])