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
import clojure.java.api.Clojure; | |
import clojure.lang.IFn; | |
/** | |
* Created by Borkdude on 15-02-14. | |
*/ | |
public class Main { | |
public static void main(String[] args) { | |
Object vector = Clojure.read("[1 2 3 4 5]"); |
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
user=> (defmacro ^:private my-macaroni [] | |
#_=> `(+ 1 2 3)) | |
#'user/my-macaroni | |
user=> (my-macaroni) | |
6 | |
user=> (ns other-user) | |
nil | |
other-user=> (user/my-macaroni) | |
IllegalStateException var: #'user/my-macaroni is not public clojure.lang.Compiler.isMacro (Compiler.java:6412) |
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
user=> (read-string (pr-str (keyword "foo bar"))) | |
:foo | |
user=> (keyword "foo bar") | |
:foo bar | |
user=> (pr-str *1) | |
":foo bar" | |
user=> (read-string (pr-str (keyword "foo bar"))) | |
:foo |
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
;;; To add a tooltip, write (tooltip {:className "foo"}) instead of #js {:className "foo"} | |
;;; You can simplify this and just show what you need: #js {:title (pr-str (om/...))}. | |
;;; testfoo.core (cljs) | |
(ns testfoo.core | |
(:require-macros [testfoo.macros :refer (tooltip)]) | |
(:require [om.core :as om :include-macros true] | |
[om.dom :as dom :include-macros true] | |
[cljs.reader :as reader])) |
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
(ns flappy-bird-demo.core | |
(:require | |
[sablono.core :as sab :include-macros true] | |
[figwheel.client :as fw] | |
[cljs.core.async :refer [<! chan sliding-buffer put! close! timeout]]) | |
(:require-macros | |
[cljs.core.async.macros :refer [go-loop go]])) | |
(enable-console-print!) |
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
Recipe websites: | |
http://www.straightupfood.com/ | |
http://www.healthyveganlife.com/ | |
http://www.plantbasedchristian.com/ | |
http://happyherbivore.com/ | |
http://klunkerskitchen.blogspot.nl/ | |
Youtube Channels with recipes: |
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 prime? [n] | |
(cond (= n 2) true | |
(= n 3) true | |
:else | |
(not-any? #(zero? (mod n %))(range (int (Math/sqrt n)) n)))) | |
(def my-primes (filter prime? (iterate inc 2))) | |
(defn update-or-insert [m k f d] | |
(if (contains? m k) |
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 force-set [n] | |
(if (set? n) n | |
(conj #{} n))) | |
(merge-with (fn [r l] (conj (force-set r) l)) {:a 1 :b 2} {:a 1 :b 3}) | |
=> {:a #{1}, :b #{2 3}} |
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 siever2 [to-sieve sieved end] | |
(if (empty? to-sieve) sieved | |
(let [f (first to-sieve) | |
r (rest to-sieve)] | |
(if (> f (Math/sqrt end)) | |
(into sieved to-sieve) | |
(siever2 (remove #(zero? (mod % f)) r) | |
(conj sieved f) | |
end))))) | |
(dotrace [siever2] (siever2 (range 2 32) [] 31)) |
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
public class ButtonOperator extends Button { | |
/*public ButtonOperator(final CalculatorController controller, | |
final AbstractOperator op) { | |
super(op.label); | |
this.addClickHandler(new ClickHandler() { | |
@Override | |
public void onClick(ClickEvent event) { | |
controller.processOperator(op); |
OlderNewer