Skip to content

Instantly share code, notes, and snippets.

Avatar
🏄‍♂️
𝓢𝓾𝓻𝓯𝓲𝓷𝓰 - 𝓽𝓱𝓮 - 𝓬𝔂𝓫𝓮𝓻𝓼𝓹𝓪𝓬𝓮

Victor Bjelkholm victorb

🏄‍♂️
𝓢𝓾𝓻𝓯𝓲𝓷𝓰 - 𝓽𝓱𝓮 - 𝓬𝔂𝓫𝓮𝓻𝓼𝓹𝓪𝓬𝓮
View GitHub Profile
View gist:dca8a79335a87cadf1cbef063bdd2c5c
#! /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")
View imaletyoufinish.js
function resolveLater() {
return new Promise(resolve => {
setTimeout(() => {
resolve('finish');
}, 2000);
});
}
async function asyncCall() {
console.log('let');
View machine.js
// 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)
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View federation.old.md

I opened a preliminary PR (https://github.com/open-services/open-registry/pull/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.

View keybase.md

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:

View pull-streams-madness.js
function addPipeline (index, addStream, list) {
pull(
zip(
pull.values(list),
pull(
pull.values(list),
paramap(fs.stat.bind(fs), 50)
)
),
pull.map((pair) => ({
View twicefunction.js
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 Sep 5, 2016
Makes it clear if you're on a private Github repository or not by making the header background BLACK!
View a-readme.md
@victorb
victorb / replify
Created Aug 19, 2016 — forked from danielrw7/ replify
replify - Create a REPL for any command
View replify
#!/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"
You can’t perform that action at this time.