Skip to content

Instantly share code, notes, and snippets.

@rgkirch
rgkirch / wsl2-usbip.org
Last active July 16, 2023 17:59
wsl2 usbip

don’t forget to run these at some point

flutter doctor --android-licenses
sdkmanager --licenses
JAVA_HOME=/home/me/jdk-11 # where did you install java? or maybe are you using the one bundled with android studio?
PATH=/home/me/jdk-11/bin:$PATH
ANDROID_HOME=/usr/local/android_sdk
# ANDROID_SDK_ROOT=/usr/local/android_sdk # ANDROID_SDK_ROOT, which also points to the SDK installation directory, is deprecated
PATH=/usr/local/android_sdk/platform-tools:$PATH # idk if you need these on the path but it does save some typing
@rgkirch
rgkirch / ui09.cljs
Last active June 23, 2022 02:45
Button text carousel.
(ns app.renderer.ui09
(:require
[clojure.string :as string]
[meander.epsilon :as m]
[cljs.pprint :refer [pprint]]
[goog.dom :as gdom]
[goog.Timer :as gtimer]
[missionary.core :as mi]
[cljs.spec.alpha :as s])
(:require-macros [clojure.core.strint :refer [<<]]))
(require '[missionary.core :as mi])
(require '[goog.dom :as gdom])
(defn Text
[{:keys [text] :as props}]
(let [text-node (gdom/createTextNode)
parent-div (gdom/createDom "span" nil text-node)]
(mi/stream! (mi/ap (gdom/setTextContent text-node (clj->js (mi/?< text)))))
(doseq [entry (dissoc props :text)]
(mi/stream! (mi/ap (gdom/setProperties parent-div
@rgkirch
rgkirch / 20210518185742-current_re_frame_app_state_as_a_fold_over_events.org
Created May 21, 2021 01:03
current re-frame app state as a fold over events

current re-frame app state as a fold over events

https://day8.github.io/re-frame/EffectfulHandlers/

at any one time, the value in app-db is the result of performing a reduce over the entire collection of events dispatched in the app up until that time. The combining function for this reduce is the set of registered event handlers.

void correct(function<void(char)> f) {
vector<char> cs {'\x1B','\x25','\x01','\x1B','\x26','\x01'};
for ( auto c : cs ) f(c);
}
void wrong(Object o) {
o.print("\x1B\x25\x01\x1B\x26\x01");
}
// wrong is wrong because it prints