{:db/ident :meta/tag
:db/valueType :db.type/tuple
:db/tupleAttrs [:meta/tag-namespace :meta/tag-key :meta/tag-value] ;; all unique strings
:db/cardinality :db.cardinality/one
:db/unique :db.unique/identity}
Then
(ns miracle.tools.save | |
(:require [clojure.walk :refer [postwalk]])) | |
(def ^:dynamic *max-saves* 50) | |
(defn gensym? [s] | |
(re-find #"__\d+" s)) | |
(defn fn->var | |
"Takes a function and returns a var. Works even on function objects." |
(ns applesoranges.core | |
(:require [clojure.spec.alpha :as s])) | |
;; define the properties | |
(s/def ::fruit-attribute-spec (s/keys :req [::diameter ::color])) | |
(s/def ::diameter nat-int?) | |
(s/def ::color #{:green :orange}) | |
;; define the "type"-hierarchy | |
;; seemed like a good idea to use a separate spec for the hierarchy (in order to keep things simple) |
DNS queries on home network suddenly resolving hosts to 104.239.207.44.
You will see SPORADIC mis-resolutions of EVERYTHING to that 104.239.207.44 address if their crappy router happens to hear your PC's DHCP request - EVEN IF ANOTHER DHCP SERVER ON THE NETWORK assigns the ultimate address.
Note: These workarounds covered issues in
lein-tools-deps
0.3.0-SNAPSHOT
. If using0.4.1
or later, you should not encounter the issues below.
The following provides some workarounds for some issues when using lein-tools-deps
from Cursive on macOS.
By default, the lein-tools-deps
plugin won't see /usr/local/bin/clojure
when Cursive processes project.clj
, as it evidently has a degenerate path.
You will see an error like the following in the IntelliJ Event Log when it tries to process your project.clj
file:
Using JavaScript libraries from ClojureScript involves two distinct concerns:
Right now, the only single tool that solves these probems reliably, optimally, and with minimal configuration is shadow-cljs
, and so that is what I favor. In paricular, shadow-cljs
lets you install npm modules using npm
or yarn
and uses the resulting package.json
to bundle external dependencies. Below I describe why, what alternatives there are, and what solutions I disfavor at this time.
atom.commands.add 'atom-text-editor', 'repl:eval-selected-sexp-and-replace', -> | |
if editor = atom.workspace.getActiveTextEditor() | |
if selected = editor.getSelectedText() | |
protoRepl.executeCodeInNs(selected, | |
{resultHandler: (result) -> | |
console.log(result) | |
editor.insertText(result.value)}) |
type StringBool = "true"|"false";
interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };
type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
(ns net.thegeez.advent.spec-parsing | |
(:require [clojure.string :as str] | |
[clojure.spec :as s] | |
[clojure.spec.gen :as gen] | |
[clojure.test.check.generators :as tgen])) | |
;; Dependencies: | |
;; [org.clojure/clojure "1.9.0-alpha14"] | |
;; [org.clojure/test.check "0.9.0"] | |
;; Advent of Code is a series of code challenges in the form of an advent |
This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.
The Atom documentation is excellent. It's highly worth reading the flight manual.