Skip to content

Instantly share code, notes, and snippets.

View wtrsltnk's full-sized avatar

Wouter Saaltink wtrsltnk

View GitHub Profile
@frowrik
frowrik / ImGui_Piano_imp.h
Last active June 3, 2024 02:41
Piano keyboard for ImGui v1.0
/*
The MIT License (MIT)
by https://github.com/frowrik
Piano keyboard for ImGui v1.1
example:
static int PrevNoteActive = -1;
ImGui_PianoKeyboard("PianoTest", ImVec2(1024, 100), &PrevNoteActive, 21, 108, TestPianoBoardFunct, nullptr, nullptr);
// Despite appearances to the contrary, this does proper error handling. Any error cascades into a failure of the wglGetProcAddress.
int init_opengl() {
HWND window = CreateWindowA("edit", "", WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
PIXELFORMATDESCRIPTOR format_desc = {
.nSize = sizeof(PIXELFORMATDESCRIPTOR),
.nVersion = 1,
.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL
};
@DanDiplo
DanDiplo / JS-LINQ.js
Last active March 2, 2025 13:40
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },