Skip to content

Instantly share code, notes, and snippets.

@drewr
drewr / README.org
Last active February 3, 2025 18:44
Quick slack interaction
  1. Create slack app in the UI (the command line ended up creating an unusable app)
  2. Add these oauth permissions
channels:history
channels:read
groups:history
groups:read
im:history
mpim:history
team:read

drewr on defn Podcast

2024-11-24

How a mediocre programmer did some useful things.

Bio

  • Based in Nashville, TN, USA, moved here in late 90s to briefly pursue music
  • Local community: church, transit advocacy
@drewr
drewr / index.html
Last active February 16, 2024 22:29
<!DOCTYPE html>
<html lang="en">
<head>
<title>Display a satellite map</title>
<meta property="og:description" content="Display a satellite raster baselayer." />
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='stylesheet' href='https://unpkg.com/[email protected]/dist/maplibre-gl.css' />
<script src='https://unpkg.com/[email protected]/dist/maplibre-gl.js'></script>
<style>
drewr@474b6b83 Thu 15 17:25:03 877 1 src/drewr/rustutils(main●)% nix-shell -E 'let pkgs = import <nixpkgs> {}; unstable = import <nixpkgs-unstable> {}; shell = pkgs.mkShell { buildInputs = [ unstable.cargo unstable.pkg-config unstable.openssl unstable.glibc ];}; in shell' --run "cargo build"
Compiling libc v0.2.153
Compiling proc-macro2 v1.0.78
Compiling syn v1.0.109
Compiling indexmap v1.9.3
Compiling aho-corasick v1.1.2
Compiling form_urlencoded v1.2.1
Compiling clap_lex v0.2.4
Compiling proc-macro-error-attr v1.0.4
Compiling unicode-normalization v0.1.22

Describe how you typically work to resolve conflicts with others in shared community

It’s a great question. We can’t do anything meaningful together without working through conflict, because all true relationships eventually experience it. It’s especially the case in a diverse environment with different perspectives, which is one that an academic community should strive to be.

The amount that conflict is allowed grow, I believe, is commensurate with the trust level between the two parties. As trust erodes, almost anything can cause conflict. The best way to keep trust high is by deepening each other’s understanding of the other’s motives and values. The more we understand each

@drewr
drewr / core.clj
Created July 9, 2022 21:18
Redeem NYT gift code
(ns freenyt.core
(:gen-class)
(:require [etaoin.api :as eta]
[etaoin.keys :as k]))
;;(def driver (eta/firefox-headless))
(defn -main [& args]
(let [driver (eta/safari)]
(eta/go
driver (str "https://www.nytimes.com/subscription"
% zig build && ./zig-out/bin/main https://github.com/drewr/zigutils
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
drewr / init.el
Created June 10, 2020 21:00
org-roam and helm debugging
(eval-after-load 'helm
'(require 'helm-config))
;; ....
(use-package helm
:ensure t
:pin "melpa"
:requires (async popup)
:config
@drewr
drewr / jurassic_park.clj
Last active December 10, 2018 13:31
java -cp clojure-1.9.0.jar clojure.main /tmp/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*)]
(cond

After you've created a GKE cluster, run:

kubectl apply -f <(curl -s https://gist.githubusercontent.com/drewr/4bdc3540ecb6c4ddf8058c59692ea7a8/raw/es-k8s.yaml)`

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