Skip to content

Instantly share code, notes, and snippets.

@jagij
jagij / avicii-levels.js
Created December 30, 2018 18:03
Avicii levels for micro:bit
// use https://makecode.microbit.org/# to generate the executable code
input.onButtonPressed(Button.B, function () {
const levels = [
'F#5:2',
'E5:2',
'E5:2',
'R:2',
'E5:2',
'E5:2',
'E5:2',
@jagij
jagij / longpoll.js
Created July 12, 2018 11:58
Short node program to test whether your fake-sqs supports long-polling
const AWS = require('aws-sdk');
const sqsOptions = {
endpoint: process.env.SQS_ENDPOINT || 'https://sqs.eu-west-1.amazonaws.com',
region: process.env.AWS_REGION || 'eu-west-1',
}
const sqs = new AWS.SQS(sqsOptions);
const queueName = process.env.SQS_QUEUE_NAME || "SQS_QUEUE_NAME";
@jagij
jagij / patcharoo.sh
Created July 7, 2018 11:21
Patch zbar with some patch from sourceforge
mkdir source
cd source
echo 'deb-src http://archive.raspbian.org/raspbian/ stretch main contrib non-free rpi' | sudo tee -a /etc/apt/sources.list
sudo apt-get update
apt-get source libzbar0
cd zbar-0.10+doc
wget https://sourceforge.net/p/zbar/patches/42/attachment/disable_32bit_color_depth.patch
@jagij
jagij / test.sh
Created May 25, 2018 20:14
Run of uuid generation benchmark with and without BFP JIT enabled
# echo 0 > /proc/sys/net/core/bpf_jit_enable
# docker run --rm -it -v $PWD:/bla -w /bla node:8 ./linux -m 1000000
Ran 1000000 loops in 19.346576528s
# docker run --privileged --rm -it -v $PWD:/bla -w /bla node:8 ./linux -m 1000000
Ran 1000000 loops in 3.599587578s
# echo 1 > /proc/sys/net/core/bpf_jit_enable
@jagij
jagij / perf_confined.svg
Created May 24, 2018 10:33
Flamegraph comparison between two docker runs: with and without seccomp=unconfined
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.