This file contains hidden or 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
| // unit tests for ServiceKernel.js (https://gist.github.com/4089076) | |
| // requires QUnit test framework | |
| module("ServiceKernelTests"); | |
| if (typeof throws === "undefined") throws = raises; | |
| test("require unregistered service throws", function () { | |
| var kernel = new ServiceKernel(); |
This file contains hidden or 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 simple JavaScript dependency injection container | |
| * By Monroe Thomas http://blog.coolmuse.com | |
| * | |
| * http://blog.coolmuse.com/2012/11/11/a-simple-javascript-dependency-injection-container/ | |
| * | |
| * MIT Licensed. | |
| * | |
| * Unit tests can be found at https://gist.github.com/4270523 |
This file contains hidden or 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 replace-nth [col n v] | |
| (let [index (dec n) | |
| eq? (partial = index) | |
| to (empty col)] | |
| (into to (map #(if (eq? %2) v %1) col (range))))) | |
| (replace-nth [7 1 2 3 4 5 6 8] 4 "tttt") |
This file contains hidden or 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
| { | |
| :id "dev" | |
| :source-map true | |
| :source-map-timestamp true | |
| :source-map-path "public/js" | |
| :output-to "public/js/main.js" | |
| :output-dir "public/js" | |
| :asset-path "js" | |
| :foreign-libs [ | |
| {:file "http://ariutta.github.io/svg-pan-zoom/dist/svg-pan-zoom.min.js" |
This file contains hidden or 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 component.core | |
| (:require [reagent.core :as r] | |
| [com.stuartsierra.component :as component])) | |
| (enable-console-print!) | |
| (defrecord Database [host port] | |
| component/Lifecycle | |
| (start [component] |
This file contains hidden or 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
| (defmacro defattrs [ & params ] | |
| (let [forms# (map (fn [[a# b#]] (conj (list a# (conj (list b# :attributes) 'comp)) 'def)) (partition 2 params))] | |
| `(list ~@forms#) | |
| )) |
This file contains hidden or 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 rand-str [len] | |
| (apply str (take len (repeatedly #(char (+ (* 32 (rand-int 2)) (rand 26) 65)))))) |
This file contains hidden or 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 javafx-app.todo | |
| (:require | |
| [flatland.useful.debug :refer [?]] | |
| [fn-fx.fx-dom :as dom] | |
| [fn-fx.diff :refer [component defui render should-update?]] | |
| [fn-fx.controls :as ui])) | |
| (def main-font (ui/font :family "Helvetica" :size 20)) | |
| (defui TodoItem |