Skip to content

Instantly share code, notes, and snippets.

@funmaker
funmaker / server.js
Created May 27, 2021 09:09
YT 24/7 Radio Script
import path from "path";
import fs from "fs";
import fsPromise from "fs/promises";
import cp from "child_process";
import { fileURLToPath } from 'url';
import lame from "@suldashi/lame";
import Canvas from "canvas";
// HOW TO:
// 1) choose streaming target, eg yt
@funmaker
funmaker / 4chan_image_resizer.user.js
Last active July 25, 2022 13:29
Resize images before post to meet 4chan's limits
// ==UserScript==
// @name 4chan image resizer
// @version 0.6
// @description Resize images before post to meet 4chan's limits
// @author Fun Maker
// @namespace https://gist.github.com/00793ba842b12538d95e0fc3d8c626cd
// @match http*://boards.4chan.org/*
// @match http*://boards.4channel.org/*
// @icon https://4chan.org/favicon.ico
// @updateURL https://gist.github.com/funmaker/00793ba842b12538d95e0fc3d8c626cd/raw/4chan_image_resizer.user.js
@funmaker
funmaker / StartLoveOfProgram.ass
Created August 10, 2020 13:19
English Subtitles for Full LamazeP's Start love of program
[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: LamazeP - Start love of program
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None
PlayResX: 1280
PlayResY: 720
const { Decoder, Encoder, tools: {readVint, writeVint, createFloatBuffer} } = require('ts-ebml');
const fs = require("fs");
const decoder = new Decoder();
const encoder = new Encoder();
const file = fs.readFileSync(process.argv[2]);
const data = decoder.decode(file);
const out = [];
@funmaker
funmaker / denied.js
Created January 21, 2020 14:10
Denied
#!/usr/bin/env node
const { createCanvas, loadImage } = require('canvas')
const argv = require('minimist')(process.argv.slice(2));
const fs = require('fs')
const cp = require('child_process');
const denied = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAAAeCAQAAAA7+qCVAAABC0lEQVRYw+2X6w6CMBSD+/4vXRN/KNtpy4iwoVFjgpdwPkrbObA+MPFVBq9DgYLBDZ4TYXgnmL8yX6MM29FFtyEBT7z2zVH77smBSTiq0dqKwcx624NZrswbsfGM6uS6XECcCMMhUChQymxPVxeKeqSwdaPQKFOt3CijruAoDEto62D1SVGmVcTD0IZUj1czFJxVBuE2MdRXf5spPKMcFD2D6Bn1a23VmiZv5oE0Jc/4JNFCWpSrekYrg9i/Rpm91kFonuQZh4NeGR3Z2jrcdZhPU6o+mSYHw0GYFHTfYy9l8hLQD3HfQ2jQNzBiIYBEcIbv3FwEH//TuxqGR2HOStMv7Q7WbW5x2732AzuLL2wdDjdNAAAAAElFTkSuQmCC";
const approved = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAAAeCAQAAAA7+qCVAAABAklEQVRYw+2XUQrDMAxDdf9Le7CPrZ4lR4GSpLCNQUtL+qzK8oKoHyz8lQfvQwGDwQHfhTBxEsxfmccoE/nRRTdLwBtrvxzlszcHFuGwRMsRg5XxNoLZrswXMXmGZXIdFyALwW4ChgKmzHW5OijqEcOeU6ZaOSnDKrgLRq8rlMmKaJiQTeoqw+GkMmheUzTx5SjDHNR6Bq1n2N2uMtrMRjd1nsHkOAmROFifM2jzN82mGkQhrzkpFNTcDUr1TFhnoxRi0H30yW5
@funmaker
funmaker / _G.lua
Last active October 28, 2019 22:33
Noita Modding API.
_G = {
["AddFlagPersistent"] = "function: 0x05e6af38, C function";
["AddMaterialInventoryMaterial"] = "function: 0x05e67cd0, C function";
["AutosaveDisable"] = "function: 0x05e68090, C function";
["BiomeMapGetName"] = "function: 0x05e684b0, C function";
["BiomeMapGetPixel"] = "function: 0x05e68370, C function";
["BiomeMapGetSize"] = "function: 0x05e682e0, C function";
["BiomeMapGetVerticalPositionInsideBiome"] = "function: 0x05e68450, C function";
["BiomeMapLoadImage"] = "function: 0x05e683b8, C function";
["BiomeMapLoadImageCropped"] = "function: 0x05e68400, C function";
@funmaker
funmaker / exportVars.js
Last active September 19, 2020 13:50
[LESS Plugin] Exports all visible LESS variables to CSS custom properties in the scope of @plugin call
let vars;
registerPlugin({
install(less, pluginManager, functions) {
functions.add('exportVars', () => {
return vars;
});
},
eval(context) {
#!/bin/node
// Requires:
// imagemagic
// xdotool
// xclip
const email ='EMAIL';
const apikey ='APIKEY';
const saveFolder = 'STORAGE_FOLDER';
@funmaker
funmaker / Balls.js
Created August 20, 2018 13:11
Balls
let goldSilver = 0;
let goldGold = 0;
Array.prototype.random = function () {
return this.splice(Math.floor((Math.random()*this.length)), 1)[0];
}
for(let i = 0; i < 1000000; i++) {
let boxes = [["Gold", "Gold"], ["Gold", "Silver"], ["Silver", "Silver"]];
const midi = [
// copy your notes here, like this:
// {
// "name": "E3",
// "midi": 52,
// "time": 52.81666666666657,
// "velocity": 0.7086614173228346,
// "duration": 0.13333333333333286
// }
// I've generated them from midi file using https://tonejs.github.io/MidiConvert/