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 foo.core | |
(:refer-clojure :exclude [slurp])) | |
(defmacro slurp [file] | |
(clojure.core/slurp file)) | |
;; In CLJS | |
(ns bar.core | |
(:require [foo.core :include-macros true :refer [slurp]])) |
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 noprompt.cypher | |
(:require [clojure.string :as str] | |
[clojurewerkz.neocons.rest.cypher :as cy] | |
[clojure.walk :as walk]) | |
(:import java.lang.StringBuilder)) | |
;; Example usage: | |
(comment | |
;; Query: | |
(start {:n (node [3 1])} |
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 mix* | |
"Helper function for mix." | |
{:private true} | |
[colls] | |
(if (seq colls) | |
(if (seq (first colls)) | |
(lazy-seq (cons (ffirst colls) | |
(mix* (conj (subvec colls 1) | |
(rest (first colls)))))) | |
(recur (subvec colls 1))) |
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
(defproject semantic-gs "0.1.0-SNAPSHOT" | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[compojure "1.1.5"] | |
[garden "0.1.0-beta5"] | |
[hiccup "1.0.3"]] | |
:plugins [[lein-ring "0.8.5"]] | |
:ring {:handler semantic-gs.handler/app} | |
:profiles | |
{:dev {:dependencies [[ring-mock "0.1.5"]]}}) |
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
(require '[meander.epsilon :as m]) | |
(m/rewrite (read-string (slurp "project.clj")) | |
(defproject _ _ . !key !value ...) | |
(m/cata [:DEPS_EDN (m/map-of !key !value)]) | |
[:DEPS_EDN {:dependencies ?dependencies | |
:profiles ?profiles | |
:source-paths !paths | |
:resource-paths !paths}] |
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 longest-prefix-at | |
[s i] | |
(let [max-k (. s length)] | |
(or (last (for [j (range 1 max-k) | |
:let [k (+ i j)] | |
:when (<= k max-k) | |
:let [s1 (subs s 0 j) | |
s2 (subs s i k)] | |
:while (= s1 s2)] | |
s2)) |
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
{:paths ["src"] | |
:deps {org.clojure/clojure {:mvn/version "1.10.0"} | |
org.clojure/clojurescript {:mvn/version "1.10.439"} | |
org.clojure/test.check {:mvn/version "0.10.0-alpha3"} | |
com.google/clojure-turtle {:mvn/version "0.3.0"} | |
meander/delta {:mvn/version "0.0.85"} | |
quil/quil {:mvn/version "3.0.0"}} | |
:aliases {:test {:extra-paths ["test"] | |
:extra-deps {org.clojure/test.check {:mvn/version "0.10.0-alpha3"} | |
com.cognitect/test-runner {:git/url "https://github.com/healthfinch/test-runner" |
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 meander.interpret.delta | |
(:require [meander.match.delta :as r.match] | |
[meander.syntax.delta :as r.syntax] | |
[meander.util.delta :as r.util])) | |
(defn genmut | |
[] | |
{:tag :mut | |
:symbol (gensym "*m__")}) |
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 swap | |
"Swap the elements at positions `i` and `j` in `v`." | |
{:private true} | |
[v i j] | |
(-> v | |
(assoc i (nth v j)) | |
(assoc j (nth v i)))) | |
;; SEE: https://en.wikipedia.org/wiki/Heap%27s_algorithm | |
(defn permutations |
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 scratch | |
(:require | |
[clojure.data.json :as json] | |
[clojure.string :as string] | |
[meander.strategy.alpha :as r] | |
[meander.match.alpha :as r.match])) | |
(def service-2-json | |
(json/read-str | |
(slurp "https://raw.githubusercontent.com/aws/aws-sdk-java-v2/master/services/batch/src/main/resources/codegen-resources/service-2.json"))) |
NewerOlder