Skip to content

Instantly share code, notes, and snippets.

@bhurlow
bhurlow / Depot
Last active March 2, 2024 23:17
lscpu from CI
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: ARM
Model name: Neoverse-V1
Model: 1
Thread(s) per core: 1
Core(s) per cluster: 16
VERSION 0.8
FROM debian:bookworm-slim
WORKDIR /app
init:
RUN apt-get update
RUN apt-get install -y curl dnsutils host gnupg python3 ca-certificates make g++ git
RUN curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install && chmod +x install && ./install
RUN sleep 5000
RUN bb --version
@bhurlow
bhurlow / macros.clj
Created November 30, 2023 05:08
java.util.Function converion macros
(defmacro as-function [f]
`(reify java.util.function.Function
(apply [this arg#]
(~f arg#))))
(defmacro as-consumer [f]
`(reify java.util.function.Consumer
(accept [this arg#]
(~f arg#))))
@bhurlow
bhurlow / malli.clj
Created March 2, 2022 19:30
schema generation
(ns yd.seed.core
(:require [malli.core :as m]
[malli.error :as me]
[malli.generator :as mg]))
(def event-types
[:enum
:post
:comment
:reaction
@bhurlow
bhurlow / temp_sensor.txt
Created December 3, 2021 14:11
Temp Sensor Readouts
383981
2021-12-03 03:02:44.754101; 40.00 %RH; -50.00 °C
383931
2021-12-03 03:02:46.927674; 40.00 %RH; -50.00 °C
383980
2021-12-03 03:02:49.106408; 40.00 %RH; -50.00 °C
383999
2021-12-03 03:02:51.284882; 40.00 %RH; -50.00 °C
384063
2021-12-03 03:02:53.463237; 41.00 %RH; -50.00 °C
@bhurlow
bhurlow / compose.js
Created November 18, 2019 20:12
Async Composition
const R = require('ramda')
const maybeFoo = next => async item => {
console.log('maybeFoo', item)
item.data++
return next(item)
}
const maybeBar = next => async item => {
console.log('maybeBar', item)
@bhurlow
bhurlow / async.sh
Created September 13, 2019 15:25
async bash example
#! /bin/bash
cust_func(){
echo "Do something $1 times..."
sleep 1
}
# For loop 5 times
for i in {1..5}
do
@bhurlow
bhurlow / chan.js
Created May 30, 2018 19:26
async iteratros with buffer limit
function chan(n) {
let internalQueue = []
let drain = null
async function* wrappedIterator() {
while (true) {
if (internalQueue.length) {
if (drain) drain()
yield internalQueue.shift()
}
### Keybase proof
I hereby claim:
* I am bhurlow on github.
* I am bhurlow (https://keybase.io/bhurlow) on keybase.
* I have a public key ASCpmfCmKZXpos21zxXdNiafraKs12mdiVC-PZEAJDWUnQo
To claim this, I am signing this object:
alias ga 'git add'
alias gaa 'git add .'
alias gaaa 'git add -A'
alias gb 'git branch'
alias gbd 'git branch -d '
alias gc 'git commit'
alias gcm 'git commit -m'
alias gco 'git checkout'
alias gcob 'git checkout -b'
alias gcom 'git checkout master'