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
;;Using the Cassowary constraint solver from ClojureScript | |
;;This demo shows using multimethods for readable constraint syntax using +, -, and =. | |
;;Output is a row of circles with random radii spaced so that the space between their boundaries is uniform. | |
(ns c2.main | |
;;refer-clojure :exclude is currently broken in ClojureScript master | |
;;Ticket open: http://dev.clojure.org/jira/browse/CLJS-114 | |
;;Fix applied here: https://github.com/lynaghk/clojurescript/tree/114-refer-clojure-exclude | |
(:refer-clojure :exclude [+ - =]) | |
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
(scss->clj "/Users/noprompt/git/yui/pure/src/grids/css/grids-core.css" | |
'pure.grids) | |
;; => | |
((ns | |
pure.grids | |
(:require [garden.stylesheet] [garden.units] [garden.def])) | |
(garden.def/defstyles | |
grids | |
[".pure-g" | |
{:letter-spacing "-0.31em"} |
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 firstshot.chessknightmove | |
(:refer-clojure :exclude [== >= <= > < =]) | |
(:use clojure.core.logic | |
clojure.core.logic.arithmetic)) | |
(defn knight-moves | |
"Returns the available moves for a knight (on a 8x8 grid) given its current position." | |
[x y] | |
(let [xmax 8 ymax 8] | |
(run* [q] |
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 runtime-infer-demo.server-port | |
{:lang :core.typed | |
:core.typed {:features #{:runtime-infer}}} | |
(:require [clojure.core.typed :as t] | |
[clojure.spec :as s])) | |
(deftest configure-server-port-test | |
(is | |
(= (-> | |
(configure-server-port |
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
;; an answer to http://kotka.de/blog/2010/03/The_Rule_of_Three.html#summary | |
;; memoize from core.clj: | |
(defn memoize | |
[f] | |
(let [mem (atom {})] | |
(fn [& args] | |
(if-let [e (find @mem args)] | |
(val e) | |
(let [ret (apply f args)] |
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 qaxl.core | |
(:use clojure.walk clojure.pprint qaxl.cache) | |
(:require [co.paralleluniverse.pulsar.async :as qa] | |
[clojure.core.async :as a] | |
[co.paralleluniverse.pulsar.core :as q] | |
[clojure.test :refer [function?]] | |
[co.paralleluniverse.fiber.httpkit.client :as hk] | |
[co.paralleluniverse.pulsar.core :refer [fiber]] | |
[clojure.core.match :refer [match]])) |
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
;;Using the Cassowary constraint solver from ClojureScript | |
;;This demo shows using multimethods for readable constraint syntax using +, -, and =. | |
;;Output is a row of circles with random radii spaced so that the space between their boundaries is uniform. | |
(ns c2.main | |
;;refer-clojure :exclude is currently broken in ClojureScript master | |
;;Ticket open: http://dev.clojure.org/jira/browse/CLJS-114 | |
;;Fix applied here: https://github.com/lynaghk/clojurescript/tree/114-refer-clojure-exclude | |
(:refer-clojure :exclude [+ - =]) | |
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
(def react-navigation (js/require "react-navigation")) | |
; Core | |
(def createNavigationContainer (.-createNavigationContainer react-navigation)) | |
(def StateUtils (.-StateUtils react-navigation)) | |
(def PropTypes (.-PropTypes react-navigation)) | |
(def addNavigationHelpers (.-addNavigationHelpers react-navigation)) | |
(def NavigationActions (.-NavigationActions react-navigation)) |
OlderNewer