Skip to content

Instantly share code, notes, and snippets.

View stelabouras's full-sized avatar
👾

Stelios Petrakis stelabouras

👾
View GitHub Profile
@alurm
alurm / README.md
Last active July 27, 2026 00:58
A generic dynamic array in C that stores no capacity and needs no struct

A generic dynamic array in C that stores no capacity and needs no struct

The following header shows a way to make a generic dynamic array in C with an array of two pointers:

  • one pointer (accessible as vec_ptr[vec]) points to the data;
  • the other pointer (accessible as vec_len[vec]) encodes the length of the array in the pointer. Thus, (size_t)vec_len[vec] returns the len as size_t.

So, int *vec[2] = { 0 }; is an empty dynamic array of ints. struct person *people[2] = { 0 }; is an empty dynamic array of people.

The vec_push(vec, value) macro pushes a value at the end of a dynamic array. It returns true if pushing succeeded, and false otherwise. Note that the dynamic array is not automatically freed on failure.

@samhenrigold
samhenrigold / 001_NEW27_task_overview.txt
Last active August 5, 2026 02:04
iOS 27 system prompts
# Owning binary : TextComposerRuntime
# Status : NEW in iOS 27 (not in 26.5.1)
# Source : embedded __cstring in dyld_shared_cache_arm64e (24A5355q)
======================================================================
# Task Overview:
You are a composition agent that helps users create personalized written content (emails, messages, documents, posts, stories, etc.)
As an Assistant, you must:
1. Analyze the request to determine if you have sufficient information
@jake-stewart
jake-stewart / color256.md
Last active July 27, 2026 00:56
Terminals should generate the 256-color palette

Terminals should generate the 256-color palette from the user's base16 theme.

If you've spent much time in the terminal, you've probably set a custom base16 theme. They work well. You define a handful of colors in one place and all your programs use them.

The drawback is that 16 colors is limiting. Complex and color-heavy programs struggle with such a small palette.

@xeubie
xeubie / next-gen-sqlite.md
Last active June 19, 2026 00:30
The next-gen SQLite won't look like SQLite

SQLite was thought of as a toy for many years until we all realized it was actually nice to use a database as a library, even server-side. And yet...

  1. It's a big dependency, despite what you think. In no universe is 150,000 lines of C code "lightweight".
  2. Like with all SQL databases, you have an impedance mismatch: the way you store data in memory is completely different than the table structure a SQL database forces on you, leading to tons of glue code.
  3. It's mutable, so it can't undo or time travel, and it can't read while a write is happening (even in WAL mode...reads can't happen during checkpointing!).

To solve these problems, I'm building a database called xitdb:

  1. At only about 4,000 lines of code with no dependencies, xitdb is actually lightweight. You could reimplement it in another language pretty easily.
  2. It exposes rich data structures rather than a SQL interface, so the API is very similar to the in-memory data structures you already use in your program.
@gingerbeardman
gingerbeardman / crt-shader.frag
Created January 5, 2026 11:56
CRT effect as fragment shader for Love2D
// Final CRT shader with all effects including curvature
uniform float scanlineIntensity; // Adjust intensity (0-1)
uniform float scanlineCount; // Number of scanlines
uniform float time; // For flicker effect
uniform float yOffset; // Vertical drift to combat moiré pattern
uniform float brightness; // Overall brightness
uniform float contrast; // Contrast adjustment
uniform float saturation; // Color saturation
uniform float bloomIntensity; // Bloom effect intensity
@rebane2001
rebane2001 / glass-with-controls.html
Last active April 15, 2026 16:21
glass effect test css/svg thing (messy) - demo: https://codepen.io/rebane2001/details/OPVQXMv
<div style="position:absolute;top:-999px;left:-999px">
<svg
id="effectSvg"
width="200"
height="200"
viewBox="0 0 200 200"
xmlns="http://www.w3.org/2000/svg">
<filter id="displacementFilter4">
@HansKristian-Work
HansKristian-Work / gs.hpp
Created March 20, 2025 18:46
PlayStation 2 GS Dump - HelloTriangle
// SPDX-FileCopyrightText: 2024 Arntzen Software AS
// SPDX-FileContributor: Hans-Kristian Arntzen
// SPDX-FileContributor: Runar Heyer
// SPDX-License-Identifier: LGPL-3.0+
// Simplified header for standalone demo purposes :)
#pragma once
#include <stdint.h>
@hackermondev
hackermondev / research.md
Last active August 7, 2026 21:24
Unique 0-click deanonymization attack targeting Signal, Discord and hundreds of platform

hi, i'm daniel. i'm a 15-year-old high school junior. in my free time, i hack billion dollar companies and build cool stuff.

3 months ago, I discovered a unique 0-click deanonymization attack that allows an attacker to grab the location of any target within a 250 mile radius. With a vulnerable app installed on a target's phone (or as a background application on their laptop), an attacker can send a malicious payload and deanonymize you within seconds--and you wouldn't even know.

I'm publishing this writeup and research as a warning, especially for journalists, activists, and hackers, about this type of undetectable attack. Hundreds of applications are vulnerable, including some of the most popular apps in the world: Signal, Discord, Twitter/X, and others. Here's how it works:

Cloudflare

By the numbers, Cloudflare is easily the most popular CDN on the market. It beats out competitors such as Sucuri, Amazon CloudFront, Akamai, and Fastly. In 2019, a major Cloudflare outage k

@rmtbb
rmtbb / ChatGPT Canvas HTML Renderer from Clipboard.url
Last active August 2, 2026 10:23
Bookmarklet that lets you render a full HTML page with any included css and javascript that is currently copied to your clipboard. Also works for SVG code. Useful with ChatGPT Canvas
javascript:(function(){try{navigator.clipboard.readText().then(function(t){if(t){var e=window.open("","_blank","width=800,height=600");e.document.open(),e.document.write(t),e.document.close()}else alert("Clipboard is empty. Please copy some text to the clipboard first.")}).catch(function(t){console.error("Failed to read clipboard contents: ",t),alert("An error occurred while trying to access the clipboard. Please ensure your browser allows clipboard access.")})}catch(t){console.error("An error occurred:",t),alert("An error occurred while trying to open the new window with the clipboard content.")}})();//bookmarklet_title: HTML Preview from Clipboard
@rain-1
rain-1 / organize images using AI.md
Last active December 25, 2025 23:54
organize images using AI

Organize Images into folders using AI

This is a tool that sorts images into folders using "AI". You create the folders you want the images to be put into.

I got 'claude' to write with a couple prompts. Make venv and install deps with pip.