Skip to content

Instantly share code, notes, and snippets.

View jochemstoel's full-sized avatar
💭
Dematerializing

Jochem Stoel jochemstoel

💭
Dematerializing
View GitHub Profile
@jochemstoel
jochemstoel / imagemagick-ubuntu.txt
Created February 23, 2022 11:43 — forked from nickferrando/imagemagick-ubuntu.txt
Install ImageMagick with JPG, PNG and TIFF Delegates - Ubuntu (20.04)
#These are the steps required in order to Install ImageMagick with JPG, PNG and TIFF delegates.
sudo apt-get update
#Install Build-Essential in order to configure and make the final Install
sudo apt-get install build-essential
#libjpg62-dev required in order to work with basic JPG files
@jochemstoel
jochemstoel / server.js
Created July 7, 2021 23:27 — forked from kjs3/server.js
Reloading express routes/middleware on file change WITHOUT restarting node process.
if ( process.env.NODE_ENV === 'production' ) {
// dev runs with babel-node so this isn't necessary
require('babel-core/register'); // this includes the polyfill
require('newrelic');
}
import 'source-map-support/register'
import Debug from 'debug'
import express from 'express'
@jochemstoel
jochemstoel / Crop_To_Bounded_Box.py
Created March 6, 2021 14:53 — forked from kodekracker/Crop_To_Bounded_Box.py
Tensorflow Crop to bounded box and save output image file
import tensorflow as tf
# Import the image
image = tf.image.decode_png(tf.read_file("./data/Input_image.png"), channels=1)
## Set the variable values here
# Offset variables values
offset_height= 20
offset_width = 20
# Target variables values
accomplished
aggravated
alive
alone
amazed
amazing
amused
angry
annoyed
anxious
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
console.log(JSON.parse(xhttp.responseText).ip);
}
};
xhttp.open("GET", "https://api.ipify.org?format=json", true);
xhttp.send();
@jochemstoel
jochemstoel / motioninterpolation.vpy
Created February 12, 2021 01:38 — forked from phiresky/motioninterpolation.vpy
Realtime motion interpolating 60fps playback in mpv
# vim: set ft=python:
# see the README at https://gist.github.com/phiresky/4bfcfbbd05b3c2ed8645
# source: https://github.com/mpv-player/mpv/issues/2149
# source: https://github.com/mpv-player/mpv/issues/566
# source: https://github.com/haasn/gentoo-conf/blob/nanodesu/home/nand/.mpv/filters/mvtools.vpy
import vapoursynth
core = vapoursynth.get_core()
@jochemstoel
jochemstoel / MindModel.js
Created January 19, 2021 07:52 — forked from SethVandebrooke/MindModel.js
Mind Models
// generate character mind model
function MindModel() {
this.id = personality.id + ':' + intelligence.id;
this.personality = generatePersonality();
this.intelligence = generateIntelligence();
}
// 32 fundimental personality types with a total of 1,048,576 (16^5) variations.
// that's 32,768 variations per personality type
function generatePersonality() {
// variable declarations
@jochemstoel
jochemstoel / worldNameGenerator.js
Created January 18, 2021 21:59 — forked from SethVandebrooke/worldNameGenerator.js
Generate fantastical names of worlds, cities, or general places.
function generatePlace(type) {
var name = "";
var l = "bcdfghjklmnprstvwxyz";
var v = "aeiou";
var a = ["an","on","al","aph","ah"];
var b = ["or","an","ro","ain","am"];
var c = ["ia","sha","ea","ae","on","ue","a","as","in","na","o","di"];
var d = ["ph","th","sh"];
var sequences = [
@jochemstoel
jochemstoel / binaryDecisions.js
Created January 18, 2021 21:56 — forked from SethVandebrooke/binaryDecisions.js
Code for making decisions off of binary values
function bd(binaryString) {
return parseInt(binaryString, 2);
}
function db(num) {
return num.toString(2);
}
function rl(binaryString,l) {
var zeros = "";
for (var i = 0; i < l - binaryString.length; i++) {
zeros += "0";
@jochemstoel
jochemstoel / RollingCypher.js
Created January 18, 2021 21:54 — forked from SethVandebrooke/RollingCypher.js
Encrypt and decrypt text with a password and this simple yet effective cypher
function RollingCypher() {
var chars = " qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!@#$%^&*()_+-=[]\\{}|;':\",./<>?`~\t\r\n";
chars = chars.concat(chars.concat(chars));
function encrypt(s, p) {
var o = "";
s = s.split('');
p = p.split('');
for (var i = 0; i < s.length; i++) {
o += chars[chars.indexOf(s[i]) + chars.indexOf(p[i % p.length])];