Skip to content

Instantly share code, notes, and snippets.

View victorb's full-sized avatar
๐Ÿ„โ€โ™‚๏ธ
๐“ข๐“พ๐“ป๐“ฏ๐“ฒ๐“ท๐“ฐ - ๐“ฝ๐“ฑ๐“ฎ - ๐“ฌ๐”‚๐“ซ๐“ฎ๐“ป๐“ผ๐“น๐“ช๐“ฌ๐“ฎ

Victor Bjelkholm victorb

๐Ÿ„โ€โ™‚๏ธ
๐“ข๐“พ๐“ป๐“ฏ๐“ฒ๐“ท๐“ฐ - ๐“ฝ๐“ฑ๐“ฎ - ๐“ฌ๐”‚๐“ซ๐“ฎ๐“ป๐“ผ๐“น๐“ช๐“ฌ๐“ฎ
  • Stuff
  • Barcelona, Spain
  • 17:28 (UTC +08:00)
  • Bluesky @victor.earth
View GitHub Profile
@victorb
victorb / AGENTS.md
Created May 24, 2025 11:04
My current AGENTS.md for use with OpenAI's Codex

Guidelines to follow at all times:

  • Always keep your changes limited to what explicitly mentioned
  • Don't use any 3rd party libraries/framework/code unless explicitly requested
  • Focus on simplicity both in terms of design/architecture and implementation
  • Code has to be easy to reason about, and easy to extend/change in the future
  • Validate that you understand the question correctly by re-iterating what's asked of you but with different words
  • Double-check your work before committing, think outside the box and consider tradeoffs and pros/cons.
  • Consider how maintainable your changes will be, always try to create as maintainable code as possible
  • Take a step back if needed and retry if you can think of a better solution
#! /usr/bin/env bb
(import '[java.io ByteArrayOutputStream
ByteArrayInputStream
PushbackInputStream])
(require '[clojure.pprint :refer [pprint]])
(require '[bencode.core :refer [write-bencode
read-bencode]])
(defn read-bc [s]
(-> (.getBytes s "UTF-8")
function resolveLater() {
return new Promise(resolve => {
setTimeout(() => {
resolve('finish');
}, 2000);
});
}
async function asyncCall() {
console.log('let');
@victorb
victorb / machine.js
Last active January 2, 2020 11:18
Generated by XState Viz: https://xstate.js.org/viz
// useful to use together with ws-on-change for auto-updating editor
const setContentAndUpdate = (content) => {
ace.edit('brace-editor').setValue(content)
document.querySelector('button[data-variant=secondary]').click()
}
const createWebSocket = (address, onMessage) => {
const ws = new WebSocket(address)
ws.onmessage = (msg) => {
onMessage(msg.data)
@victorb
victorb / machine.js
Created December 24, 2019 10:48
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions

I opened a preliminary PR (open-services/open-registry#10) for Federation but probably best to go via a issue first, to better enable discussions around it. Here is what I've been thinking so far.

Short Version

This proposed feature of Open-Registry opens up the ability to federate servers for serving the tarballs for the registry.

Motivation

Running a global network of the scale of the npm registry will be impossible to do with just being funded by the community as the costs will be too high.

Keybase proof

I hereby claim:

  • I am victorb on github.
  • I am diggan (https://keybase.io/diggan) on keybase.
  • I have a public key ASBAwPwr86akq4x8mlexDEgSd2Ba1KJRC4Euxrn5LJJRRgo

To claim this, I am signing this object:

function addPipeline (index, addStream, list) {
pull(
zip(
pull.values(list),
pull(
pull.values(list),
paramap(fs.stat.bind(fs), 50)
)
),
pull.map((pair) => ({
let clients = {}
before(function (done) {
fc = new FactoryClient()
fc.spawnNode((err, node) => {
expect(err).to.not.exist
if (err) done(err)
clients.a = node
})
fc.spawnNode((err, node) => {
expect(err).to.not.exist
@victorb
victorb / a-readme.md
Last active September 5, 2016 21:16
Makes it clear if you're on a private Github repository or not by making the header background BLACK!