Moved to a real repo, here: https://github.com/bmaddy/beautiful-interpreter
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
{:linters {:mount/defstate {:level :warning}} | |
:hooks {:analyze-call {mount.core/defstate hooks.defstate/defstate}}} |
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
Moved to https://github.com/bmaddy/csd-vpn/blob/master/csd-responder-exec.sh |
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 async-sieve.core | |
(:require [clojure.core.async :refer [chan go go-loop <! <!! >! filter<]])) | |
;; Sieve of Eratosthenes as described here: | |
;; http://swtch.com/~rsc/thread/ | |
;; Just to clarify, this isn't how core.async should be used, it's just a fun example: | |
;; "note that async channels are not intended for fine-grained computational parallelism" | |
;; - Rich Hickey (from http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html) | |
(defn prime-filter [in primes] | |
(go |
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
{:deps | |
{org.clojure/clojure {:mvn/version "1.10.0-RC5"} | |
#_#_org.clojure/spec.alpha {:mvn/version "0.2.176"} | |
#_#_org.clojure/test.check {:mvn/version "0.10.0-alpha3"} | |
org.clojure/core.cache {:mvn/version "0.7.1"} | |
org.clojure/core.memoize {:mvn/version "0.7.1"} | |
}} |
clj -R:nrepl -m nrepl.cmdline --middleware "[cider.piggieback/wrap-cljs-repl]"
in Emacs, cider-connect
user> (require '[oops.core :refer [oset!]])
nil
user> (oset! (js-obj) :mood "a happy camper")
IllegalStateException Can't change/establish root binding of: *cljs-warnings* with set clojure.lang.Var.set (Var.java:223)
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 gadget | |
(:require [datomic.api :as d] | |
[clojure.pprint :refer [pprint pp]] | |
[clojure.inspector :as i :refer [inspect-tree]]) | |
(:import (javax.swing.tree TreeModel) | |
(javax.swing JTree JScrollPane JFrame))) | |
(defn rev-attrs | |
"Finds reverse relationships for a datomic.query.EntityMap" | |
[e] |
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 | |
# Reset routing table on OSX | |
# display current routing table | |
echo "********** BEFORE ****************************************" | |
netstat -rn | |
echo "**********************************************************" | |
for i in {0..4}; do | |
sudo route -n flush # several times |
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
# Start the app with EXPLAIN_PARTIALS=true to show locations of view partials | |
if Rails.env.development? and ENV['EXPLAIN_PARTIALS'] | |
module ActionView | |
class PartialRenderer | |
def render_with_explanation(*args) | |
rendered = render_without_explanation(*args).to_s | |
# Note: We haven't figured out how to get a path when @template is nil. | |
start_explanation = "\n<!-- START PARTIAL #{@template.inspect} -->\n" | |
end_explanation = "\n<!-- END PARTIAL #{@template.inspect} -->\n" | |
start_explanation.html_safe + rendered + end_explanation.html_safe |
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 cljs-demo.http | |
(:require [cljs.nodejs :as node])) | |
(def http | |
(node/require "http")) | |
(defn handler [_ res] | |
(.writeHead res 200 (js-obj "Content-Type" "text/plain")) | |
(.end res "Hello World!\n")) |
NewerOlder