Skip to content

Instantly share code, notes, and snippets.

View yankooliveira's full-sized avatar

Yanko Oliveira yankooliveira

View GitHub Profile
@yankooliveira
yankooliveira / shadertoy_upload.js
Last active May 11, 2025 10:56
Shadertoy Channel Uploader bookmarklet
// Shadertoy is awesome but it's hard to set your own textures. This adds a small bar to the top that lets you
// upload images to each channel.
//
// Installation: create a new bookmark and copy the following code into the `url` field:
javascript:(function(){const s=[{filter:'mipmap',wrap:'clamp',vflip:'true',srgb:'true',internal:'byte'},{filter:'linear',wrap:'clamp',vflip:'true',srgb:'false',internal:'byte'},{filter:'nearest',wrap:'clamp',vflip:'true',srgb:'false',internal:'byte'},{filter:'mipmap',wrap:'clamp',vflip:'true',srgb:'true',internal:'byte'}];const N=4;if(typeof gShaderToy==='undefined'){console.error("ShaderToy environment (gShaderToy) not found.");alert("ShaderToy environment (gShaderToy) not found. Ensure you are on a ShaderToy page.");return;}let ec=document.getElementById('customUploadControls');if(ec){ec.remove();}let ef=document.getElementById('customFileInput');if(ef){ef.remove();}const u=document.createElement('div');u.style.cssText='padding:10px;background-color:#2a2a2a;border-bottom:1p
@yankooliveira
yankooliveira / __init__.py
Created April 13, 2025 23:02
Just a perfectly normal delighter.
# Done 0-shot with Gemini 2.5 based on this: https://editor.p5js.org/yanko.oliveira/full/0RsR9Z8Ix
import torch
import torch.nn.functional as F
import numpy as np
# --- Constants ---
# Using the standard Rec.709 / sRGB luminance weights
LUMA_WEIGHTS_NP = np.array([0.2126, 0.7152, 0.0722], dtype=np.float32)
MIN_DIVISOR = 0.02 # Minimum divisor to prevent division by zero/extreme values
@yankooliveira
yankooliveira / gdc_vault_2019_extended.json
Created March 20, 2024 22:10
GDC Vault 2019 JSON data
[
{
"companies": [
"Independent"
],
"description": "Drawing on her experience from working as a stand-up comedian for 2 years, and using examples from the development of the acclaimed 'Grace Bruxner Presents: The Haunted Island, a Frog Detective Game', this talk focuses on the process of creating comedy games. Beyond writing jokes for games, this lecture presents a more nuanced look at building games around humor, and Grace will go into the specifics of writing funny dialogue that doesn't feel stilted or forced by finding the comedy in the ordinary. Along the way, she will also be looking at how games can subvert expectations of genre to aid in silliness, drawing comparisons between 'The Haunted Island' and other recent comedy-focused and/or narrative games.",
"id": "1025651",
"speakers": "Grace Bruxner",
"tags": [
"Independent",
@yankooliveira
yankooliveira / CodeSnippetBuilder.cs
Created April 1, 2021 23:20
If you have the terrible idea of making a prototype using CodeDOM and explicit snippets like I did, this helps controlling indentation. I'm pretty sure there's a smarter way, but it's not like I think before I type when I make prototypes 😅
using System.Text;
namespace deVoid.Utils {
// Uses an internal StringBuilder instance and automatically keeps tracks of indentation.
public class CodeSnippetBuilder {
public int IndentLevel {
get { return _indentLevel; }
set {
if (value < 0) {
value = 0;
@yankooliveira
yankooliveira / GrammarReplace.cs
Created December 25, 2020 11:07
A recursive grammar replacer based on [tags].
// ! Gamejam code, proceed with caution!
// GetFromList is an extension method:
// public static T GetFromList<T>(this Random rnd, List<T> list) {
// var index = rnd.Next(list.Count);
// return list[index];
// }
namespace deVoid.Apothecary {
[CreateAssetMenu(fileName = "GrammarConfig", menuName = "Apothecary/Grammar Config")]