Skip to content

Instantly share code, notes, and snippets.

View bplaat's full-sized avatar

Bastiaan van der Plaat bplaat

View GitHub Profile
@jake-stewart
jake-stewart / color256.md
Last active March 9, 2026 20:31
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.

@faustinoaq
faustinoaq / myAngular.html
Last active January 17, 2026 17:44
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
@nicolas17
nicolas17 / yellow.asm
Last active January 22, 2026 14:40
hello-world iOS app
.global _main
.extern _putchar
.align 4
_main:
; prolog; save fp,lr,x19
stp x29, x30, [sp, #-0x20]!
str x19, [sp, #0x10]
@bplaat
bplaat / mariadb-uuid-functions.sql
Last active May 1, 2023 17:45
MariaDB UUID_TO_BIN and BIN_TO_UUID pollyfills
DELIMITER //
CREATE FUNCTION UUID_TO_BIN(u CHAR(36))
RETURNS BINARY(16)
BEGIN
IF u IS NULL THEN
RETURN NULL;
END IF;
SET u = REPLACE(u, '-', '');
RETURN CONCAT(
@bplaat
bplaat / opengl.c
Created May 30, 2022 20:53
Win32 OpenGL 1.0 Example
// Win32 OpenGL 1.0 Example
// gcc opengl.c -c -o opengl.o && ld -s opengl.o -lkernel32 -luser32 -lgdi32 -lopengl32 -o opengl.exe -e _start && ./opengl
// --subsystem windows
#define UNICODE
#include <windows.h>
#include <GL/gl.h>
// Window state
wchar_t *windowTitle = L"Win32 OpenGL Example";
UINT windowWidth = 1280;
@bplaat
bplaat / .htaccess
Created December 30, 2021 17:27
Yet another single file PHP MVC framework
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php [L]
@thales17
thales17 / msys2-SDL2-Setup.md
Last active March 31, 2025 04:16
msys2 sdl2 setup

Download and install msys2 64bit

Update msys2

  • Update msys2 64bit after install by running pacman -Syu if pacman needs to be updated you might have to close and reopen the terminal and run pacman -Syu again

Install build tools

  • pacman -S git mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_mixer mingw64/mingw-w64-x86_64-SDL2_image mingw64/mingw-w64-x86_64-SDL2_ttf mingw64/mingw-w64-x86_64-SDL2_net mingw64/mingw-w64-x86_64-cmake make

Compile Hello World

https://youtu.be/-C-JoyNuQJs?t=39m45s
When I put the reference implementation onto the website I needed to
put a software license on it.
And I looked at all the licenses that were available, and there were a lot
of them. And I decided that the one I liked the best was the MIT License,
which was a notice that you would put on your source and it would say,
"you're allowed to use this for any purpose you want, just leave the
notice in the source and don't sue me."
@Overv
Overv / HelloTriangle.cc
Created April 24, 2016 18:54
Vulkan hello triangle
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <chrono>
#include <functional>
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
@paulirish
paulirish / bling.js
Last active February 27, 2026 04:33
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };