Skip to content

Instantly share code, notes, and snippets.

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

Victor Bjelkholm victorb

🏄‍♂️
𝓢𝓾𝓻𝓯𝓲𝓷𝓰 - 𝓽𝓱𝓮 - 𝓬𝔂𝓫𝓮𝓻𝓼𝓹𝓪𝓬𝓮
View GitHub Profile
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"
@victorb
victorb / Dockerfile
Last active Jul 21, 2016
Dockerfile for NodeJS in production. List of available versions: https://github.com/mhart/alpine-node
View Dockerfile
FROM mhart/alpine-node:6.3.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/package.json
RUN npm install
COPY . /usr/src/app
View circleci
2.3.0-alpine - running container
2.1-alpine - building image
2.1.9-alpine - building image
2.2.4-alpine - building image
2.3.0-alpine - running container
2.1-alpine - building image
2.1.9-alpine - running container
2.2.4-alpine - building image
2.3.0-alpine - running container
2.1-alpine - building image
You can’t perform that action at this time.