This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A comparison of Collection+JSON, HAL, JSON-LD and SIREN media types. | |
Discussion at | |
http://sookocheff.com/posts/2014-03-11-on-choosing-a-hypermedia-format/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn add1 [n] | |
(+ n 1)) | |
(defn sub1 [n] | |
(- n 1)) | |
(defn plus [n m] | |
(cond | |
(zero? m) n | |
:else (add1 (plus n (sub1 m))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn rember [atom l] | |
(loop [lat (seq l) res []] | |
(if lat | |
(let [f (first lat)] | |
(if (= f atom) | |
(next lat) | |
(recur (next lat) (conj res f)))) | |
res))) | |
(defn firsts [lol] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn atom? [x] | |
(not (seq? x))) | |
(defn lat? [x] | |
(loop [l x] | |
(cond | |
(empty? l) true | |
(atom? (first l)) (recur (last l)) | |
:else false))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn atom? [x] | |
(not (seq? x))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function $(id) { | |
var $ = document.getElementById(id); | |
var opacityTo = function (elm, v) { | |
elm.style.opacity = v/100; // CSS3 | |
elm.style.MozOpacity = v/100; // FF | |
elm.style.KhtmlOpacity = v/100; // Safari | |
elm.style.filter=" alpha(opacity ="+v+")"; // IE | |
}; |