Skip to content

Instantly share code, notes, and snippets.

View vittau's full-sized avatar

Vitor Machado vittau

View GitHub Profile
@vittau
vittau / sirs-data-generator.js
Last active November 6, 2022 21:52
SIRS model data generator
const fs = require("fs");
function writeToFile(i, { component, content }) {
try {
fs.writeFileSync(`sirs-data-${i}-${component.toLowerCase()}.dat`, content);
// file written successfully
} catch (err) {
// eslint-disable-next-line no-console
console.error(err);
}
@vittau
vittau / sir-data-generator.js
Created January 30, 2022 20:14
Creates sample data for an SIR model plot
const fs = require("fs");
const TOTAL_POPULATION = 100000;
const INITIAL_INFECTED_POPULATION = 1;
const ALPHA = 1;
const BETA = 3;
const TIME_TICK = 0.1;
const MAXIMUM_TIME = 20;
if (TIME_TICK <= 0) throw new Error("Time tick must be greater than zero");
@vittau
vittau / vhs.js
Last active September 9, 2020 07:15
VHS Curve Bend points generator
// VHS Curve Bend points generator to be used in GIMP with the Curve Bend tool.
// For great vaporwave.
function generate_val(intensity) {
return Math.round(127 - intensity / 2 + Math.random() * intensity);
}
const INTENSITY = process.argv[2] || 1.15;
console.log("POINTFILE_CURVE_BEND\nVERSION 1.0");
@vittau
vittau / cloudSettings
Last active August 20, 2020 23:20
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-20T23:20:51.934Z","extensionVersion":"v3.4.3"}