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 April 26, 2025 16:35
Clutter-free VS Code Setup
image
@marvinhagemeister
marvinhagemeister / bind-plugin.ts
Last active December 16, 2024 14:38
Preact Signals `bind:value`
import { options } from "preact";
import { Signal } from "@preact/signals";
// Add `bind:value` to JSX types
declare global {
namespace preact.createElement.JSX {
interface HTMLAttributes {
"bind:value"?: Signal<string | string[] | number | undefined>;
}
}
@JolifantoBambla
JolifantoBambla / webgpu-audio.html
Last active October 24, 2024 22:16
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 April 28, 2025 14:23
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 December 2, 2024 02:21
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