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
import math | |
import os | |
import struct | |
import subprocess | |
import time | |
import wave | |
# inspired by https://github.com/kristiandupont/react-geiger | |
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
#!/usr/bin/env bash | |
if [ ! -f notebook.clj ]; then | |
INITIAL_FILE=$(cat <<EOF | |
^{:nextjournal.clerk/toc :collapsed | |
:nextjournal.clerk/visibility :hide-ns} | |
(ns user | |
"https://book.clerk.vision | |
https://emmy.mentat.org" | |
(:require |
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
#!/usr/bin/env bash | |
# travel upwards to find the nearest `.overmind.sock` so you can issue | |
# eg `ov r` or `ov c` from any subdir in a project, instead of having to | |
# cd up to where the Procfile is. | |
set -e | |
dnif () { | |
# https://stackoverflow.com/a/24642735 |
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
❯ pkgutil --expand Zoom.pkg Zoom | |
❯ cd Zoom | |
❯ l | |
total 4 | |
-rw-r--r-- 1 rgm staff 1386 Apr 8 19:05 Distribution | |
drwx------ 11 rgm staff 352 Apr 8 19:05 Resources/ | |
drwx------ 6 rgm staff 192 Apr 8 19:05 zoomus.pkg/ | |
❯ cd zoomus.pkg | |
❯ l | |
total 20116 |
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
(defn my-regular-handler | |
[req] | |
{:status 200 :headers {} :body []}) | |
(defn my-resource-handler | |
[datasource req] | |
(let [foo (do-something-with-datasource datasource req)] | |
{:status 200 :headers {} :body foo})) | |
(defn make-top-level-handler |
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 rgm.re-frame-subscription-graph | |
"Generate a graphviz .dot from re-frame subscriptions. | |
Sometimes the signal graph can get hard to grok. These two fns hijack | |
re-frame's subscription registration to harvest these inter-sub dependencies | |
as data, at which point we can produce .dot syntax and rely on graphviz | |
(or .dot-compatible tools like Omnigraffle) for quick-and-dirty visualization. | |
Usage: | |
- refer `subscribe` and `reg-sub` into subscription-registering |
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 rgm.kaocha-notifier | |
(:require [clojure.java.shell :refer [sh]])) | |
;; special thanks for terminal-notify stuff to | |
;; https://github.com/glittershark/midje-notifier/blob/master/src/midje/notifier.clj | |
(defmacro exists? | |
[program] | |
`(= 0 (:exit (sh "which" ~program)))) |
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
{:paths ["src/clj"] | |
:deps {com.bhauman/rebel-readline {:mvn/version "0.1.4"} | |
org.clojure/clojurescript {:mvn/version "1.10.339"} | |
reagent {:mvn/version "0.8.1" | |
:exclusions [cljsjs/react | |
cljsjs/react-dom | |
cljsjs/react-dom-server | |
cljsjs/create-react-class]} | |
re-frame {:mvn/version "0.10.6"}} |
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
(figwheel-sidecar.repl-api/repl-env (:figwheel-system reloaded.repl/system) nil) | |
;; => | |
;; clojure.lang.ArityException: Wrong number of args (2) passed to: repl-api/repl-env | |
;; clojure.lang.Compiler$CompilerException: clojure.lang.ArityException: Wrong number of args (2) passed to: repl-api/repl-env, compiling:(user.clj:49:3) | |
(:figwheel-system reloaded.repl/system) | |
;; => #figwheel_sidecar.system.FigwheelSystem{:system #atom[#<SystemMap> 0x49742821], :system-running true} | |
(-> reloaded.repl/system | |
(get-in [:figwheel-system :system]) |
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 skeleton.fourth.charts | |
(:require | |
[om.next :as om :refer-macros [defui]] | |
[om.dom :as dom] | |
[sablono.core :as sab :refer-macros [html]] | |
[devcards.core :as dc :refer-macros [defcard]] | |
[cljsjs.d3 :as d3])) | |
(def canvas-size 200) | |
(def num-points 5) |
NewerOlder