Skip to content

Instantly share code, notes, and snippets.

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

Victor Bjelkholm victorb

🏄‍♂️
𝓢𝓾𝓻𝓯𝓲𝓷𝓰 - 𝓽𝓱𝓮 - 𝓬𝔂𝓫𝓮𝓻𝓼𝓹𝓪𝓬𝓮
View GitHub Profile
@victorb
victorb / normalize.css
Created August 28, 2012 22:45
normalize.css
/*! normalize.css v1.0.0 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/*
* Corrects `block` display not defined in IE 6/7/8/9 and Firefox 3.
*/
@victorb
victorb / app.js
Created September 24, 2013 16:37
Easy AngularJS Directive for Google Places Autocomplete
var myApp = angular.module('myApp', []);
myApp.directive('googleplace', function() {
return {
require: 'ngModel',
link: function(scope, element, attrs, model) {
var options = {
types: [],
componentRestrictions: {}
};
#! /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 / pre-commit
Created January 9, 2014 14:05
Make sure there is no var_dump, die or console.log in new changes
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# # Installation:
# touch .git/hooks/pre-commit
# chmod u+x .git/hooks/pre-commit

Why is Google blocking Inbox on Firefox?

Recently, Google launched a new service called Inbox. It's basically Gmail re-invented with a different UI and UX. It's a good tool which improved my ability to keep a zero email inbox. I'm currently using the Android application of Inbox and not at all on the desktop, since it's not available for Firefox, my default browser. This requires me to open up Inbox in Google Chrome if I want to see it. Opening up Inbox in Firefox gives the following message:

Image of Inbox message if using Firefox

But, I couldn't understand why it's only available in Google Chrome so I started investigating on why it's so.

User Agent hack

@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: