Skip to content

Instantly share code, notes, and snippets.

View 0b5vr's full-sized avatar

0b5vr 0b5vr

View GitHub Profile
@0b5vr
0b5vr / compeko.js
Last active April 3, 2024 03:11
compeko: pack JavaScript into a self-extracting html+deflate
#!/usr/bin/env -S deno run --allow-read --allow-write --allow-run
// compeko - pack JavaScript into a self-extracting html+deflate
// v2.0.0
// Copyright (c) 2022-2024 0b5vr
// SPDX-License-Identifier: MIT
// Usage:
// - prepare a js code, which will be fed into `eval`
@0b5vr
0b5vr / vite-shader-minifier-plugin.ts
Last active January 31, 2024 12:19
vite-shader-minifier-plugin
// vite-shader-minifier-plugin
// Copyright (c) 2022 0b5vr
// SPDX-License-Identifier: MIT
// Compatible with Shader Minifier 1.2
// https://github.com/laurentlb/Shader_Minifier/releases/tag/1.2
// Usage:
// - Make sure `shader_minifier.exe` is visible via PATH
@0b5vr
0b5vr / config.json
Last active December 9, 2023 06:39
Bonzomatic MIDI config for Novation LaunchControl XL
{
// ...
"midi": {
"fKnobA1": 13,
"fKnobA2": 14,
"fKnobA3": 15,
"fKnobA4": 16,
"fKnobA5": 17,
"fKnobA6": 18,
"fKnobA7": 19,
@0b5vr
0b5vr / bonzo-fft.frag
Created December 7, 2023 15:13
BonzomaticのFFTを丁寧に使う
// (c) 2023 0b5vr, MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O
@0b5vr
0b5vr / renban.bat
Last active December 6, 2023 04:45
Batch: png to gif
@echo off
setlocal
rem (c) 0b5vr, MIT License https://opensource.org/licenses/MIT
set START=0
set WIDTH=-1
set COLORS=32
set RATE=50
set OUTPUT=renban.gif
@0b5vr
0b5vr / twiv.bat
Last active December 6, 2023 04:40
Batch: ffmpeg video trimmer optimized for Twitter
@echo off
setlocal
rem (c) 0b5vr, MIT License https://opensource.org/licenses/MIT
set FILE=""
set START=0
set TIME=139
set WIDTH=-1
set OUTPUT=twiv.mp4
@0b5vr
0b5vr / vidya2gif.bat
Last active December 6, 2023 04:16
Batch: any video to gif
@echo off
setlocal
rem (c) 0b5vr, MIT License https://opensource.org/licenses/MIT
set FILE=""
set START=0
set TIME=65536
set WIDTH=-1
set COLORS=32
@0b5vr
0b5vr / command.bat
Created September 7, 2023 13:56
Minification result of MinimalGL default shader
rem based on minify.bat
"C:\Users\0b5vr\Documents\Workspace\minimal_gl\x64\Release\shader_minifier.exe" graphics_fragment_shader.i -o graphics_fragment_shader.inl --format c-array || exit /b 5
@0b5vr
0b5vr / mod.hexpat
Created August 26, 2023 06:05
rough prototype of protracker module pattern for imhex
#include <std/io.pat>
#include <std/math.pat>
fn charString(str value) {
return value;
};
fn u16LengthInWords(u16 value) {
return 2 * value;
};
@0b5vr
0b5vr / vhs.hlsl
Last active May 26, 2023 03:58
Windows Terminal VHS Pixel Shader You Definitely Are Not Gonna Need This
/**
* (c) 2021 FMS_Cat, MIT License
* Original shader: https://www.shadertoy.com/view/MdffD7
* I dumbass don't know what it says despite it's my own shader
*/
Texture2D shaderTexture;
SamplerState samplerState;
cbuffer PixelShaderSettings {