Skip to content

Instantly share code, notes, and snippets.

@Eiyeron
Eiyeron / imgui-gruvbox.cpp
Last active March 21, 2024 03:21
Gruvbox theme for dear imgui
void gruvboxDark()
{
auto &style = ImGui::GetStyle();
style.ChildRounding = 0;
style.GrabRounding = 0;
style.FrameRounding = 0;
style.PopupRounding = 0;
style.ScrollbarRounding = 0;
style.TabRounding = 0;
style.WindowRounding = 0;
@Eiyeron
Eiyeron / LLT.c
Last active March 6, 2024 19:55
Long Line Theory, finally in C. Enjoy one the best bytebeat directly from your terminal without Javascript!
#include <stdio.h>
#include <math.h>
#define min(a, b) (a) < (b) ? (a) : (b)
#define max(a, b) (a) > (b) ? (a) : (b)
int main(int t, char** argc) {
double sb, y, h, a, d, g;
@Eiyeron
Eiyeron / debug_viz.py
Created August 31, 2023 09:43
Basic geometry debug REPL
import bpy
def add_mesh(name, verts, faces, edges=None, col_name="Collection"):
if edges is None:
edges = []
mesh = bpy.data.meshes.new(name)
obj = bpy.data.objects.new(mesh.name, mesh)
col = bpy.data.collections[col_name]
col.objects.link(obj)
bpy.context.view_layer.objects.active = obj
@Eiyeron
Eiyeron / CMakeLists.txt
Created January 22, 2023 18:07
PlayDate CMake template
cmake_minimum_required(VERSION 3.14)
set(CMAKE_C_STANDARD 11)
set(ENVSDK $ENV{PLAYDATE_SDK_PATH})
if (NOT ${ENVSDK} STREQUAL "")
# Convert path from Windows
file(TO_CMAKE_PATH ${ENVSDK} SDK)
else()
execute_process(
@Eiyeron
Eiyeron / eb_shader.glsl
Last active November 10, 2021 13:25
Earthbound-ish background shader
/*
Copyright © 2019, Florian Dormont
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 X 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
@Eiyeron
Eiyeron / Bubble Fortune
Created April 9, 2021 17:47
Bubble Fortune
- Bubble Fortune -
-------------------
O o . . . .
O o O O . O
. . O . O o O .
O . O . . .
o o o O o . . o o
O . o .
O o O . O O . O
o . O O o O .
@Eiyeron
Eiyeron / 50-dualsense.rules
Created December 2, 2020 11:57
Udev rules to access a dualsense controller in RW
SUBSYSTEMS=="usb", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ce6", GROUP="users", MODE="0660"
@Eiyeron
Eiyeron / import.lua
Last active December 1, 2020 13:32
New Pico-8 exporter (works with meshes bound in [(-1;-1;-1),(1;1;1)] )
function parse_vert(str, i)
local s = sub(str, (i-1)*5+1, (i-1)*5+5)
local v = sub(s, 1, 1)
local res = v.."0x0."..sub(s,2)
return tonum(res)
end
function load_verts(str)
local verts = {}
for v=0,#str/15-1 do
@Eiyeron
Eiyeron / reflect.glsl
Created October 1, 2017 14:20
Love2D shader for realtime palette swap + EB-like sine-based distorsions
#define PALETTE_SIZE 4
uniform float time = 0;
// Good old wave effect
uniform vec2 amplitude = vec2(0 / 128., 8/128.);
uniform vec2 speed = vec2(1., 2.);
uniform vec2 frequency = vec2(1, 3);
uniform float sampling_factor = 0.5;
uniform vec3 palette[PALETTE_SIZE+1];
uniform bool inverse = false;
@Eiyeron
Eiyeron / pico-8.txt
Last active May 26, 2020 13:43
Pico-8 themed Dwarf Fortress palette (using extra colors)
[BLACK_R:0]
[BLACK_G:0]
[BLACK_B:0]
[BLUE_R:29]
[BLUE_G:43]
[BLUE_B:83]
[GREEN_R:0]
[GREEN_G:135]
[GREEN_B:81]
[CYAN_R:18]