Skip to content

Instantly share code, notes, and snippets.

View Tenrys's full-sized avatar

Bell Tenrys

View GitHub Profile
@trvswgnr
trvswgnr / compress_video
Last active February 5, 2025 20:37
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in
@Earu
Earu / Shader.tsx
Created October 10, 2024 08:46
A react component capable of rendering webgl shaders
import { createRef, HTMLAttributes, useEffect, useState } from "react"
const positions = [
-1, -1, // Bottom left
1, -1, // Bottom right
-1, 1, // Top left
1, 1 // Top right
];
function createShader(gl: WebGLRenderingContext, type: GLenum, source: string): WebGLShader | null {
@cyyynthia
cyyynthia / konami.ts
Created October 15, 2024 19:55
Very small (376B minified) implementation of Konami code in TypeScript (0BSD licensed)
/*!
* BSD Zero Clause License
* Copyright (c) Cynthia Rey
* SPDX-License-Identifier: 0BSD
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY