Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
home

Robin van Emden robinvanemden

🏡
home
View GitHub Profile
View install-linux-perf-on-wsl2.sh
set -x
apt install flex bison
git clone https://github.com/microsoft/WSL2-Linux-Kernel --depth 1
cd WSL2-Linux-Kernel/tools/perf
make -j8
sudo cp perf /usr/local/bin
@robinvanemden
robinvanemden / install_latest_protobuf_ubuntu.sh
Last active Dec 30, 2020
Install latest protobuf c/c++ lib (at time of writing, 3.14.0) on Ubuntu 18.04 x86_64
View install_latest_protobuf_ubuntu.sh
#!/bin/bash
sudo apt-get install autoconf automake libtool curl make g++ unzip
##### EITHER LATEST FULL ####
# git clone --recurse-submodules https://github.com/protocolbuffers/protobuf.git /root/protobuf
##### OR C/C++ VERSION ####
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protobuf-cpp-3.14.0.tar.gz
tar -zxvf protobuf-cpp-3.14.0.tar.gz
View wasm-summit-2020-notes.md

WebAssembly Summit 2020

https://webassembly-summit.org/

Lin Clark's Talk - "WebAssembly Nanoprocess"

  • the missing functionality alongside WASI and Interface Types is something that provides "capability-based security".
  • Delegation of permissions to propagate down transitive dependencies
  • plan to use fine-grain form of per-module virtualization
  • A "WebAssembly nanoprocess" is just wasm, but follows a particular pattern.
@robinvanemden
robinvanemden / Makefile
Created Feb 14, 2020 — forked from keeferrourke/Makefile
Generic Makefile
View Makefile
# Generic makefile for a C project
# Written by Keefer Rourke <mail@krourke.org>
#
# This file is Public Domain or, in places where public domain works
# are not recognized, licensed as CC0. Legal text:
# <https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt>
#
# This Makefile should not rely and any GNU-specific functionality,
# though it is based on the GNU make documentation which is available
# at: <https://www.gnu.org/software/make/manual/make.html>
@robinvanemden
robinvanemden / toUTF8Array.js
Created Dec 14, 2019 — forked from joni/toUTF8Array.js
toUTF8Array: Javascript function for encoding a string in UTF8.
View toUTF8Array.js
function toUTF8Array(str) {
var utf8 = [];
for (var i=0; i < str.length; i++) {
var charcode = str.charCodeAt(i);
if (charcode < 0x80) utf8.push(charcode);
else if (charcode < 0x800) {
utf8.push(0xc0 | (charcode >> 6),
0x80 | (charcode & 0x3f));
}
else if (charcode < 0xd800 || charcode >= 0xe000) {
View github_webhook.php
<?php
// Webhook code to update repo clone and execute required deployement code when new commit was pushed
// Webhook content-type should be set to application/json and a random secret code should be set too.
// Secret Random Code You set on github webhook settings
const SECRET_TOKEN = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0){
throw new Exception('Request method must be POST!');
}
@robinvanemden
robinvanemden / A Boosting Algorithm for Estimating Generalized Propensity Scores.R
Created Jun 25, 2019
Code from "A Boosting Algorithm for Estimating Generalized Propensity Scores" by Zhu, Coffman, & Ghosh (2015)
View A Boosting Algorithm for Estimating Generalized Propensity Scores.R
F.aac.iter=function(i,data,ps.model,ps.num,rep,criterion) {
# i: number of iterations (trees)
# data: dataset containing the treatment and the covariates
# ps.model: the boosting model to estimate p(T_i|X_i)
# ps.num: the estimated p(T_i)
# rep: number of replications in bootstrap
# criterion: the correlation metric used as the stopping criterion
GBM.fitted=predict(ps.model,newdata=data,n.trees=floor(i),
@robinvanemden
robinvanemden / extract_frames.py
Last active May 23, 2019
Basic Python script for fast extraction of stills from videos through calls to ffmpeg using filenames and timestamps from an SPSS file
View extract_frames.py
import os
import subprocess
import pyreadstat
import logging
import datetime
# configuration
input_directory = 'C:/Users/robin/PycharmProjects/asmir_cry_project/in'
output_directory = 'C:/Users/robin/PycharmProjects/asmir_cry_project/out'
View epsilon_greedy_animation.R
library(contextual)
library(data.table)
library(animation)
## 1. Bandit Simulation ---------------------------------------------------------------------------
# Run a simulation that saves the policy's theta values
policy <- EpsilonGreedyPolicy$new(epsilon = 0.1)
bandit <- BasicBernoulliBandit$new(weights = c(0.4, 0.5, 0.3))
@robinvanemden
robinvanemden / the_assigment_problem_cookie_cutter_style_v1.R
Last active Feb 27, 2019
Movie to jury member assignment problem
View the_assigment_problem_cookie_cutter_style_v1.R
You can’t perform that action at this time.