Skip to content

Instantly share code, notes, and snippets.

View eeropic's full-sized avatar

Eero Pitkänen eeropic

View GitHub Profile
@kamilogorek
kamilogorek / _screenshot.md
Last active May 27, 2024 12:50
Clutter-free VS Code Setup
image
@JolifantoBambla
JolifantoBambla / webgpu-audio.html
Last active April 25, 2024 21:01
Create audio data in WebGPU compute shaders
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>WebGPU Audio</title>
</head>
<body>
<button type="button" id="play">Play</button>
<script type="module">
const code = `
@CarloCattano
CarloCattano / Hvcc Puredata to Web Assembly.md
Last active January 2, 2023 19:44
get heavy compiler Web Assembly export to work on linux

Install emscripten

from emscripten official docs

# Get the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git

# Enter that directory
cd emsdk
# Download and install the latest SDK tools.
./emsdk install latest
@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`
/*
* Copyright (c) 2021 - Peter Johan Salomonsen
*/
setBPM(85);
addInstrument('piano');
addInstrument('string');
addInstrument('drums');
addInstrument('guitar');
@bellbind
bellbind / call-fft-browser.js
Last active December 19, 2021 12:19
[WebAssembly] FFT
// $ wat2wasm fft.wat
// $ node --experimental-modules call-fft-dynamic.js
(async function () {
{
const res = fetch(new URL("./fft.wasm", import.meta.url).href);
const imports = {
"./math.js": await import(new URL("./math.js", import.meta.url))
};
const {instance} = await WebAssembly.instantiateStreaming(res, imports);
@fnky
fnky / ANSI.md
Last active July 22, 2024 12:03
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@korakot
korakot / checkbox.py
Last active December 2, 2022 07:00
Custom Colab widget example: Checkbox, ColorPicker, and Slider
from ctypes import cast, py_object
from google.colab import output
def set_var(v_id, value):
obj = cast(v_id, py_object).value
obj.value = value
output.register_callback('set_var', set_var)
class Checkbox:
@animoplex
animoplex / PseudoEffectXML.xml
Last active August 22, 2022 11:09
Pseudo Effect Via XML - After Effects Example XML by Animoplex
// Pseudo Effect Via XML - Example File
// Full Tutorial: https://www.youtube.com/watch?v=pHwBOFZgKcs&t=296s
// Edit the PresetEffects.xml for your version of After Effects to add Pseudo Effects.
// XML File Location on Windows:
// Program Files > Adobe > After Effects (Version) > Support Files
// XML File Location on OSX:
// Apps > After Effects > Right-click After Effects.app > “Show Contents” > Contents > Resources
@jaames
jaames / adpcm.js
Last active October 20, 2023 19:17
javascript implementation of converting 4-bit adpcm audio to float32 pcm
// ADPCM decoder implementation based on https://github.com/jwzhangjie/Adpcm_Pcm/blob/master/adpcm.c
const indexTable = [
-1, -1, -1, -1, 2, 4, 6, 8,
-1, -1, -1, -1, 2, 4, 6, 8
];
const stepSizeTable = [
7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
19, 21, 23, 25, 28, 31, 34, 37, 41, 45,