Skip to content

Instantly share code, notes, and snippets.

View zig-oom.txt
% zig build && ./zig-out/bin/main
debug: drewr zigutils
warning: The following command failed:
error: OutOfMemory
/Users/aar/Downloads/zig-macos-aarch64-0.10.0-dev.139+850b053ea/lib/zig/std/os.zig:3997:19: 0x102bdb1cb in std.os.mmap (main)
.NOMEM => return error.OutOfMemory,
/Users/aar/Downloads/zig-macos-aarch64-0.10.0-dev.139+850b053ea/lib/zig/std/heap.zig:331:17: 0x102bd8def in std.heap.PageAllocator.alloc (main)
) catch return error.OutOfMemory;
drewr / init.el
Created Jun 10, 2020
org-roam and helm debugging
View init.el
(eval-after-load 'helm
'(require 'helm-config))
;; ....
(use-package helm
:ensure t
:pin "melpa"
:requires (async popup)
drewr / jurassic_park.clj
Last active Dec 10, 2018
java -cp clojure-1.9.0.jar clojure.main /tmp/jurassic_park.clj
View jurassic_park.clj
(ns jurassic-park
"Post-movie fun with the boys"
(:require [clojure.main :as m]))
(defn jurassic-read
[request-prompt request-exit]
(or ({:line-start request-prompt :stream-end request-exit}
(m/skip-whitespace *in*))
(let [input (.readLine *in*)]

After you've created a GKE cluster, run:

kubectl apply -f <(curl -s`

That will give you a single-node instance accessible via elasticsearch:9200 around your cluster.

View atreus-disconnects.log
Apr 02 14:19:54 hotel kernel: usb 3-5.1.4: USB disconnect, device number 21
Apr 02 14:19:55 hotel kernel: usb 3-5.1.4: new full-speed USB device number 22 using xhci_hcd
Apr 02 14:19:55 hotel kernel: usb 3-5.1.4: New USB device found, idVendor=16c0, idProduct=047c
Apr 02 14:19:55 hotel kernel: usb 3-5.1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Apr 02 14:19:55 hotel kernel: usb 3-5.1.4: Product: Atreus2
Apr 02 14:19:55 hotel kernel: usb 3-5.1.4: Manufacturer: technomancy
Apr 02 14:19:55 hotel kernel: inp
drewr /
Last active Mar 8, 2021
Software Engineer, Infrastructure

Software Engineer, Infrastructure

[recruiting preamble text here]

The Infrastructure team in Elastic Engineering sits underneath the Elastic product stack and support many efforts in the company at large. Primarily we’re software developers that handle state — CI specifications, cloud resources, integrations between teams. The Elastic Stack is built on our infrastructure and we touch everything needed to get it there. We also do software consulting around the organization to put our products to use for our own business.

drewr /
Created Jan 17, 2018
Phil Freeman explaining the free monad

10:44] @loganmac Another way to think of the free monad over f is to say we want expressions of the form x >>= \a -> y >>= \b -> z ... where x, y, z :: f _

[10:45] So we just make a type by expanding f to include those terms, purely symbolically. But then to be a Monad we need the laws to hold, so we equate terms which the laws say have to be equal

[10:46] So finding the free monad over f is to find the "smallest" lawful monad which includes all such terms

drewr / core.clj
Created Jan 14, 2018
Slack websocket experiment
View core.clj
(ns shia.core
(:require [cheshire.core :as json]
[clj-http.client :as http]
[clojure.spec.alpha :as s])
(:import (org.java_websocket.client WebSocketClient)
( URI)))
(s/def :rtm/connect (s/keys :req-un [::ok ::self ::team ::url]))
(def ord (atom 0))
View PagerDuty.purs
module PagerDuty (main) where
import Prelude
import Control.Monad.Aff (launchAff)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (CONSOLE, log, logShow)
import Data.Config (Config, string)
import Data.Config.Node (fromEnv)
import Data.Either (Either(..))
View atreus2.diff
diff --git a/keyboard/atreus/config.h b/keyboard/atreus/config.h
index 5fba78e..bc3b092 100644
--- a/keyboard/atreus/config.h
+++ b/keyboard/atreus/config.h
@@ -24,7 +24,7 @@ along with this program. If not, see <>.
#define PRODUCT_ID 0xA1E5
#define DEVICE_VER 36
#define MANUFACTURER technomancy
-#define PRODUCT Atreus
+#define PRODUCT Atreus2