This file contains hidden or 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 bb | |
| (ns srt.core | |
| (:require [clojure.string :as str]) | |
| (:import | |
| [java.time LocalTime] | |
| [java.time.format DateTimeFormatter] | |
| [java.time.temporal ChronoUnit])) | |
| (def fmt (DateTimeFormatter/ofPattern "HH:mm:ss,SSS")) |
This file contains hidden or 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
| (defn- compare-possible-nums [a b] | |
| (if (and a b (re-find #"^\d+$" a) (re-find #"^\d+$" b)) | |
| (- (Long/parseLong a) (Long/parseLong b)) | |
| (compare a b))) | |
| (defn- compare-bits [[a & as] [b & bs]] | |
| (let [c (compare-possible-nums a b)] | |
| (if (and a (= 0 c)) | |
| (compare-bits as bs) | |
| c))) | |
| (defn- compare-names [a b] |
This file contains hidden or 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
| ;; in head | |
| (when dev? | |
| (list | |
| [:script {:src "https://cdn.jsdelivr.net/npm/eruda"}] | |
| [:script "eruda.init(); | |
| eruda.show();"])) |
This file contains hidden or 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
| https://www.tednasmith.com/wp-content/uploads/2021/02/TN-Moria-Gate-2021.jpg | |
| https://www.tednasmith.com/wp-content/uploads/2020/12/TN-The-Fellowship-Approaches-Moria.jpg | |
| https://www.tednasmith.com/wp-content/uploads/2018/08/TN-Durins_Crown_and_the_Mirrormere.jpg | |
| https://www.tednasmith.com/wp-content/uploads/2018/08/TN-Gwaihir_the_Windlord_Bears_Gandalf_From_Isengard.jpg | |
| https://www.tednasmith.com/wp-content/uploads/2018/05/TN-Arrival_at_Caras_Galadhon.jpg | |
| http://tednasmith.poverellomedia.com/wp-content/uploads/2012/07/TN-Leaving_the_Shire.jpg | |
| http://tednasmith.poverellomedia.com/wp-content/uploads/2012/07/TN-Under_the_Spell_of_the_Barrow-wight.jpg | |
| http://tednasmith.poverellomedia.com/wp-content/uploads/2012/07/TN-The_Balrog.jpg | |
| http://tednasmith.poverellomedia.com/wp-content/uploads/2012/07/TN-Green_Hill_Country.jpg | |
| http://tednasmith.poverellomedia.com/wp-content/uploads/2012/07/TN-Rivendell.jpg |
This file contains hidden or 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
| sqlite3 mydata.db < script.sql |
This file contains hidden or 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
| [:title (i18n "Crystal Dashboard")] | |
| [:meta {:property "og:title" :content "Crystal Dashboard"}] | |
| [:meta {:property "og:type" :content "website"}] | |
| [:meta {:property "og:url" :content "https://app.crystal2025.store/"}] | |
| [:meta {:property "og:image" :content "https://app.crystal2025.store/logo.png"}] |
This file contains hidden or 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
| (defn- mk* [m [a b & rest]] | |
| (cond | |
| (keyword? a) (recur (assoc m a b) rest) | |
| a (recur (assoc m (keyword a) (symbol a)) (list* b rest)) | |
| :else m)) | |
| (defmacro mk [& syms] | |
| (mk* {} syms)) |
This file contains hidden or 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
| /media/mmcblk0p1/apks | |
| http://ftp.udx.icscoe.jp/Linux/alpine/v3.21/main | |
| http://ftp.udx.icscoe.jp/Linux/alpine/v3.21/community | |
| # mount -o remount,rw /media/mmcblk0p1 |
This file contains hidden or 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
| (defn sh | |
| [dir & args] | |
| (let [proc (.exec (Runtime/getRuntime) | |
| ^"[Ljava.lang.String;" (into-array args) | |
| (make-array String 0) | |
| (io/as-file dir))] | |
| (with-open [stdout (.getInputStream proc) | |
| stderr (.getErrorStream proc)] | |
| (future (io/copy stdout *out*)) | |
| (future (io/copy stderr *err*)) |
NewerOlder