Inspired by "Parsing CSS with Parsec".
Just quick notes and code that you can play with in REPL.
By @kachayev
| (Chapters marked with * are already written. This gets reorganized constantly | |
| and 10 or so written chapters that I'm on the fence about aren't listed.) | |
| Programmer Epistemology | |
| * Dispersed Cost vs. Reduced Cost | |
| * Verificationist Fallacy | |
| * Mistake Metastasis | |
| The Overton Window | |
| Epicycles All The Way Down | |
| The Hyperspace Gates Were Just There |
Inspired by "Parsing CSS with Parsec".
Just quick notes and code that you can play with in REPL.
By @kachayev
| # You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
| # This is how I upload my new Sol Trader builds (http://soltrader.net) | |
| # Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
| S3KEY="my aws key" | |
| S3SECRET="my aws secret" # pass these in | |
| function putS3 | |
| { | |
| path=$1 |
| (ns virgil | |
| (:require | |
| [clojure.java.io :as io] | |
| [clojure.string :as str] | |
| [filevents.core :as fe]) | |
| (:import | |
| [javax.tools | |
| DiagnosticCollector | |
| ForwardingJavaFileManager | |
| JavaCompiler |
| (defmacro defspec-test | |
| ([name sym-or-syms] `(defspec-test ~name ~sym-or-syms nil)) | |
| ([name sym-or-syms opts] | |
| (when t/*load-tests* | |
| `(def ~(vary-meta name assoc :test `(fn [] | |
| (let [check-results# (clojure.spec.test/check ~sym-or-syms ~opts) | |
| checks-passed?# (every? nil? (map :failure check-results#))] | |
| (if checks-passed?# | |
| (t/do-report {:type :pass | |
| :message (str "Generative tests pass for " |
| #!/bin/bash | |
| # launch a clojure plain repl but with options and classpath matching project.clj | |
| # Except when project.clj changes (and on first launch), lein is not called. | |
| CODE=' | |
| (let [p (leiningen.core.project/read) | |
| args (@(var leiningen.core.eval/get-jvm-args) p) | |
| cp (with-out-str (leiningen.classpath/classpath p))] | |
| (print "ARGS=\"") | |
| (apply print args) |
| # Put this file into `~/.config/nixpkgs/overlays/idea.nix`. | |
| # Then, install IDEA with `nix-env -iA nixos.idea-community`. | |
| self: super: | |
| { | |
| jbsdk = super.callPackage ~/config/nix/jbsdk.nix {}; # you might need to override this path. | |
| idea-community = let | |
| version = "2017.2.3"; |
| a4b.amazonaws.com | |
| access-analyzer.amazonaws.com | |
| account.amazonaws.com | |
| acm-pca.amazonaws.com | |
| acm.amazonaws.com | |
| airflow-env.amazonaws.com | |
| airflow.amazonaws.com | |
| alexa-appkit.amazon.com | |
| alexa-connectedhome.amazon.com | |
| amazonmq.amazonaws.com |
A beginner-friendly REPL that combines
Clojure exceptions are really just Java exceptions under the hood. However, at times clojure shows them formatted as a map
data structure. For instance, that's what you get if you inspect them in the REBL. This is because clojure implements the Datafy protocol for Throwable
objects, delegating to clojure.core/Throwable->map.
This gist is a reminder of how to interpret that data assuming familiary with Java printed stack traces.