Skip to content

Instantly share code, notes, and snippets.

Coder of Salvation / Leon van Kammen coderofsalvation

Block or report user

Report or block coderofsalvation

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
coderofsalvation / bin2sh
Last active Apr 30, 2019
tool to include binary data (tar/zip archives etc) inside a shellscript
View bin2sh
function extract_payload()
match=$(grep --text --line-number '^PAYLOAD:$' $0 | cut -d ':' -f 1)
coderofsalvation / load.js
Last active Apr 3, 2019
load() - a deadsimple javascript function to load js/css in a controlled fashion
View load.js
* more controlled way of loading javascript & css in index.html
* purposes:
* - quicker/smoother rendering of 1st meaningful frame and css preloading animations
* - save performance by adding delays to tracker-jscode (analytics etc)
* - conditional logic (only load certain js/css files based on url-flags, server port etc)
* example:
coderofsalvation /
Last active Jan 15, 2019
hypeless zero-config node- and browsertests for javascript


$ npm i jsdom jsdom-global tap-prettify zora --save-dev

Run the tests

  • CI: run node test.js | tap-prettify - in the terminal
  • browser: run test.html
coderofsalvation / index.html
Last active Dec 1, 2018
glslCanvas variable resolution + multipass
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Hello Shader</title>
<script type="text/javascript" src=""></script>
body {
background: #101515;
View index.js
const ctx = canvas.getContext('2d');
var x = 0;
function startRecording() {
const chunks = []; // here we will store our recorded media chunks (Blobs)
const stream = canvas.captureStream(); // grab our canvas MediaStream
const rec = new MediaRecorder(stream); // init the recorder
// every time the recorder has new data, we will store it in our array
coderofsalvation / _design.gif
Last active Sep 12, 2018
scalable express 4 cluster with (worker)bus
coderofsalvation / benchmark.js
Created Aug 8, 2018
sift searching: regular expression vs Array.prototype.filter
View benchmark.js
duration = {}
cache = false
function report(s){
console.log(s+": time elapsed: "+ (new Date().getTime()-duration.start) /1000 )
function search1(data,text){
duration.start = new Date().getTime()
if( !cache ) cache = JSON.parse(data)
coderofsalvation / debug.js
Created Aug 6, 2018
easy debugging for touch devices
View debug.js
// easy debugging on touch devices:
// put 3 fingers on the screen to activate it
var debug = function(){
if( ( /(android|iphone|ipad)/gi ).test( navigator.appVersion ) ) {
var actived = false
coderofsalvation / 404.html
Last active Aug 2, 2018
custom 404 SPA redirect for gitlab/github/bitbucket pages
View 404.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8" />
sessionStorage.redirect = location.href;
View moon.html
<style type="text/css">
body, div.moon{
You can’t perform that action at this time.