I hereby claim:
- I am kwrooijen on github.
- I am kwrooijen (https://keybase.io/kwrooijen) on keybase.
- I have a public key ASD8wtzccqWjVgW2_O3-nJf4d6kPTyHnufxZ4kRYZ1f_pAo
To claim this, I am signing this object:
| ;; Very clean, but is not tail recursive! | |
| (define (dec->bin n) | |
| (cond ((zero? n) '()) | |
| (else (cons (remainder n 2) | |
| (dec->bin (quotient n 2)))))) | |
| ;; Not so clean, but is tail recursive. | |
| (define (dec->bin n) | |
| (letrec ((recc (lambda (acc n) | |
| (cond ((zero? n) acc) |
| (use-modules (srfi srfi-1) | |
| (rnrs)) | |
| (define (transform-at l i val) | |
| (let-values (((left right) (split-at l i))) | |
| (append left (cons val (cdr right))))) | |
| (display (transform-at '(1 2 3) 1 5)) ;=> '(1 5 3) |
| (define-syntax -> | |
| (syntax-rules () | |
| ([_ value] | |
| value) | |
| ([_ value snd rest ...] | |
| (cond | |
| [(list? 'snd) | |
| (let ([f (primitive-eval (car 'snd))] | |
| [args (cons value (cdr 'snd))]) | |
| (-> (apply f args) rest ...))] |
| (require 'package) | |
| (require 'ert) | |
| (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) | |
| (package-initialize) | |
| (unless (package-installed-p 'use-package) | |
| (package-refresh-contents) | |
| (package-install 'use-package)) |
I hereby claim:
To claim this, I am signing this object:
| (defrecord RefWith [key opts] | |
| ig/RefLike | |
| (ref-key [_] key) | |
| (ref-resolve [_ config resolvef] | |
| (let [[k _] (first (ig/find-derived config key)) | |
| config (update config k #(merge % opts)) | |
| v (get (ig/init config [k]) k)] | |
| (resolvef k v)))) | |
| (defn ref-with [key opts] |
| (ns dnd.core | |
| (:require | |
| [reagent.core :as r] | |
| [reagent.dom :as d])) | |
| (def default-persons | |
| [{:person/name "Kevin" | |
| :person/age 29 | |
| :person/active? true} | |
| {:person/name "Foo" |
| (deftype YggdrasilAtom [name state] | |
| clojure.lang.IAtom | |
| (reset [this f] (reset! (.-state this) f)) | |
| (swap [this a] (swap! (.-state this) a)) | |
| (swap [this a b] (swap! (.-state this) a b)) | |
| (swap [this a b c] (swap! (.-state this) a b c)) | |
| (swap [this a b c d] (swap! (.-state this) a b c d)) | |
| (compareAndSet [this a b] (compare-and-set! (.-state this) a b)) | |
| (toString [this] (str (.-name this))) |
| (defmulti exception->map | |
| (fn [^SQLException e] | |
| (.getSQLState e))) | |
| (defn- remove-quotes [s] | |
| (clojure.string/replace s #"\"" "")) | |
| (defn sql-key->keyword [sql-key] | |
| (-> sql-key | |
| (string/replace #"_key$" "") |
| FROM clojure:openjdk-8-lein-slim-buster AS build-jar | |
| # Install any dependencies e.g. NPM for Clojurescript | |
| # RUN apt update && apt install npm -y | |
| WORKDIR /usr/src | |
| COPY . . | |
| # Build the uberjar. If you need to prepare certain things for your release | |
| # (e.g. build your Clojurescript with Shadow-cljs) you can add a `:prep-tasks` | |
| # key to the `:uberjar` profile in your `project.clj`. `lein-shell` can also be | |
| # used to execute shell commands such as `npm`. |