Skip to content

Instantly share code, notes, and snippets.

;; CLJ REPL
(require 'my.core)
(read-string (pr-str (my.core/circle 3)))
;;=> #my.core.Circle2{:p [0.0 0.0], :r 3}
;; CLJS REPL
(require 'my.core
;; I'm running the clj command inside this project:
;; https://github.com/dimovich/deps-cider-cljs-reagent
;; clj -R:figwheel -C:figwheel -Sdeps '{:deps {org.clojure/tools.trace {:mvn/version "0.7.10"}}}' -i trace.clj -m figwheel.main -b dev -r
(ns user)
@dimovich
dimovich / sass.clj
Created September 10, 2019 16:10
compile Sass when using figwheel-main
;; use with deps.edn
;; {:aliases {:sass {:main-opts ["-i sass.clj -m figwheel.main -b dev"]}}}
(require '[clojure.java.shell :as sh]
'[figwheel.main.watching :as fww])
(println "watching Sass...")
;; change comand and location of sass files as needed
;; using
;; https://github.com/dimovich/fressian-handlers/blob/caching/src/fressian/handlers.clj
(require '[fressian.handlers :as fh]
'[clojure.data.fressian :as fres]
'[clojure.core.async :as async]
'[clojure.java.io :as io])
(def ch (async/chan))
(require '[clara.rules.durability.fressian :as cf]
'[clara.rules.platform :as pform]
'[clara.rules.durability :as d]
'[clojure.data.fressian :as fres]
'[clojure.core.async :as async]
'[clojure.java.io :as io])

Multi-window, multi-terminal split

Two terminal windows open, one with a bunch of long running watch tasks, the other with an editor. Each of the terminals is a view into one of two windows in a tmux session. Useful for having a vertically split screen with editor on right, and switching between a browser and other command windows on the left.

In first terminal:

  • tmux new-session -s first
  • tmux rename-window editor
  • emacs or whatever

In second terminal:

  • tmux new-session -t first -s second
@dimovich
dimovich / README.md
Created August 22, 2019 19:42 — forked from iantruslove/README.md
Building a simple ClojureScript single page web application [Den of Clojure Feb 2014]

Beyond hello world: building a simple ClojureScript single page web application

Shown at Feb '14 Den of Clojure

Intro

So you've read the blogs and thought how fun it would be to write web front ends with your favorite lisp. Perhaps you've even fired up the repl and done a little playing. But how do you get from there to a

@dimovich
dimovich / Den-of-Clojure-intro-1-talk.md
Created August 22, 2019 19:41 — forked from iantruslove/Den-of-Clojure-intro-1-talk.md
Den of Clojure - Intro to Clojure part 1

A gentle introduction to Clojure

Lisp Cycles (XKCD 297 / https://xkcd.com/297/)

Ian Truslove

Den of Clojure

2016-04-21


@dimovich
dimovich / fw-trace-fail.txt
Last active March 11, 2021 11:15
Figwheel failing to start cljs-repl on Firefox
TRACE t7890: (figwheel.main/-main "-b" "dev" ...)
TRACE t7891: | (figwheel.main/get-edn-file-key "figwheel-main.edn" :log-level)
TRACE t7892: | | (figwheel.main/get-edn-file-key "figwheel-main.edn" :log-level ...)
TRACE t7892: | | => nil
TRACE t7891: | => nil
TRACE t7893: | (figwheel.main/fix-simple-bool-args # #)
TRACE t7893: | => ("-b" "dev" "-r")
TRACE t7894: | (figwheel.main/validate-cli! #)
TRACE t7895: | | (figwheel.main/get-edn-file-key "figwheel-main.edn" :validate-cli ...)
TRACE t7895: | | => true
@dimovich
dimovich / .dir-locals.el
Last active July 28, 2019 12:22
Minimal ClojureScript + Reagent + CIDER
((nil
(cider-clojure-cli-global-options . "-A:cider")
(cider-default-cljs-repl . figwheel-main)
(cider-figwheel-main-default-options . ":dev")))