Skip to content

Instantly share code, notes, and snippets.

View bplaat's full-sized avatar
💻
Working from home on cool shit...

Bastiaan van der Plaat bplaat

💻
Working from home on cool shit...
View GitHub Profile
@faustinoaq
faustinoaq / myAngular.html
Last active July 1, 2025 14:07
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;
@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 July 23, 2025 07:08
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)); };
@kirelagin
kirelagin / Huffman.lhs
Created October 13, 2012 21:44
Very simple implementation of Huffman coding in Haskell
> module Huffman where
> import Control.Arrow
> import Data.List
> import qualified Data.Map as M
> import Data.Function
This typeclass is supposed to make life _a bit_ easier.