Skip to content

Instantly share code, notes, and snippets.

@julianfrank
julianfrank / urlQueryParser.js
Created August 30, 2016 07:40
Parse URL from Client JS
/*While window.location.search can be useful I'd much rather the search property be a key: value object.
An object would be nice but as long as we can get one property at a time, that would suffice.
The following is a function stolen from the A-Frame VR toolkit:*/
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};
@julianfrank
julianfrank / cache.go
Created November 2, 2016 11:46
Simple Caching for single server instance in go
package main
import (
"io"
"log"
"net/http"
"os"
"strconv"
"strings"
"time"
@julianfrank
julianfrank / cachev2.go
Created November 2, 2016 16:50
golang simple local cache code
package main
import (
"fmt"
"io"
"log"
"net"
"net/http"
"os"
"strconv"
@julianfrank
julianfrank / nextpow2.js
Last active December 4, 2016 13:49
Function Returns the Next Power of 2 of the given number...Minimum Output is 2
function nextPow2(x) {
return Math.pow(2, Math.round(Math.max(x,0)).toString(2).length);
}
@julianfrank
julianfrank / SketchSystems.spec
Created November 15, 2018 06:03
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State
@julianfrank
julianfrank / install-docker.md
Created March 4, 2019 07:34 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command
@julianfrank
julianfrank / cg recursion try
Created April 9, 2019 10:08
cg recursion try
/*process.stdin.resume();
process.stdin.setEncoding('ascii');
var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;
process.stdin.on('data', function (data) {input_stdin += data;});
process.stdin.on('end', function () {
input_stdin_array = input_stdin.split("\n");
    */
@julianfrank
julianfrank / enableBootMessages.sh
Created June 8, 2019 09:54
shell to disable graphical boot in Pop OS
# simulate
sudo kernelstub -c -v -a "splash=false quiet=false"
# Actual command to deactivate graphical boot
sudo kernelstub -v -a "splash=false quiet=false"
@julianfrank
julianfrank / pixijs.spritesheet
Created August 20, 2019 14:02
For working with pixijs spritesheet animations
/*sheet._frameKeys.map(t=>txs.push( PIXI.utils.TextureCache[t]))
console.log(txs)
let bird1 = new PIXI.AnimatedSprite(txs);
console.log(bird1)*/