Skip to content

Instantly share code, notes, and snippets.

@joelnet
joelnet / croc-transfer-SKILL.md
Last active May 2, 2026 00:31
Claude skill to tranfer files / directories between agents using croc

name: croc-transfer description: Send or receive a file between two machines using croc (https://github.com/schollz/croc). Use this skill whenever the user wants to transfer, send, share, copy, ship, or grab a file between two hosts — desktop ↔ server, laptop ↔ Raspberry Pi, between two computers in different places, between two people, or between two agents/terminals — even if they don't say "croc" but describe the workflow ("get this file over to my pi", "ship the build artifact to the other box", "have someone else download this CSV from me", "I need to receive a file from another machine"). Croc works peer-to-peer when a direct path exists (LAN, Tailscale, WireGuard) and falls back to a public TCP relay otherwise. The skill handles installation, picks a code phrase, runs the right command for the user's role (sender or receiver), and reads the transfer logs to surface whether bytes went peer-to-peer or via the public relay. The skill is transport-agnostic about how the code phrase reaches the other pa

const pipe = require('ramda/src/pipe')
const curry = require('ramda/src/curry')
const clampA = (min, max, value) => {
let newValue = Number(value)
newValue = Math.min(max, newValue)
newValue = Math.max(min, newValue)
return newValue
}
@joelnet
joelnet / keybase.md
Created September 9, 2019 20:36
keybase.md

Keybase proof

I hereby claim:

  • I am joelnet on github.
  • I am joelnet (https://keybase.io/joelnet) on keybase.
  • I have a public key ASBhE_5H8aJ_C-JIpSwxrk42nUN2c1I_f0Fe6jmlWphKhgo

To claim this, I am signing this object:

@joelnet
joelnet / es6-proxy-set.js
Created August 20, 2019 17:11
ES6 Proxy Set
/**
* Demo for https://twitter.com/joelnet/status/1163820524709076992
*/
class Person {
constructor(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
}
// Y Combinator
const Y = a => (b => b (b)) (b => a (c => b (b) (c)))
// isomorphic Church encoding/decoding
const Church = {
to: n => f => x => Array.from (Array (n)).reduce (f, x),
from: f => f (x => x + 1) (0)
}
const True = a => b => a
@joelnet
joelnet / boolean-expressions-ski.js
Last active August 5, 2019 08:42
Boolean Logic with the SKI Combinators
// S and K are primitive function combinators.
const S = a => b => c => a (c) (b (c))
const K = a => b => a
// Non-primitive combinators can be created with S and K.
const C = S (S (K (S (K (S)) (K))) (S)) (K (K))
const I = S (K) (K)
const KI = K (I)
const M = S (I) (I)
const R = S (K (S (K (S)) (K))) (S (K (S (I))) (K))
@joelnet
joelnet / once.sh
Created May 30, 2019 05:13
Shell script to execute a command once (while running)
#!/bin/bash
pidfile=$1
cmd=$2
if [ -z "$pidfile" ] || [ -z "$cmd" ]; then
echo "Usage: once <pidfile> \"<command>\""
exit 0
fi
const user = { id: 100, name: 'Howard Moon' }
const password = 'Password!'
const userWithPassword = {
...user,
id: 100,
...(password && { password })
}
userWithPassword //=> { id: 100, name: 'Howard Moon', password: 'Password!' }
const renamed = ({ ID, ...object }) => ({ id: ID, ...object })
const user = {
ID: 500,
name: "Bob Fossil"
}
renamed(user) //=> { id: 500, name: 'Bob Fossil' }
const setDefaults = ({ ...object}) => ({ quotes: [], ...object })