Skip to content

Instantly share code, notes, and snippets.

View victorb's full-sized avatar
🏄‍♂️
𝓢𝓾𝓻𝓯𝓲𝓷𝓰 - 𝓽𝓱𝓮 - 𝓬𝔂𝓫𝓮𝓻𝓼𝓹𝓪𝓬𝓮

Victor Bjelkholm victorb

🏄‍♂️
𝓢𝓾𝓻𝓯𝓲𝓷𝓰 - 𝓽𝓱𝓮 - 𝓬𝔂𝓫𝓮𝓻𝓼𝓹𝓪𝓬𝓮
View GitHub Profile
#! /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!
@victorb
victorb / replify
Created August 19, 2016 17:18 — forked from danielrw7/ replify
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for [%s]\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "\n%s> " "$command"