Skip to content

Instantly share code, notes, and snippets.

View mmozeiko's full-sized avatar

Mārtiņš Možeiko mmozeiko

View GitHub Profile
@mbinna
mbinna / effective_modern_cmake.md
Last active May 3, 2024 15:44
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@vurtun
vurtun / defl.c
Last active June 13, 2023 21:30
Full deflate/inflate implementation in ~300 LoC
/* ===============================================================
* SDEFL
* ===============================================================
* public domain - no warranty implied; use at your own risk
* References:
https://bitbucket.org/rmitton/tigr/src/be3832bee7fb2f274fe5823e38f8ec7fa94e0ce9/src/tigr_inflate.c?at=default&fileviewer=file-view-default
https://github.com/github/putty/blob/49fb598b0e78d09d6a2a42679ee0649df482090e/sshzlib.c
https://www.ietf.org/rfc/rfc1951.txt
*/
#include <stdlib.h>
@alanstevens
alanstevens / Windows11_Setup.md
Last active April 9, 2024 13:37
Windows 11 Setup

This guide was created using Microsoft Windows 11 Pro

Version 21H2 build 22000.194

Installation

System Updates:

  • Settings -> Windows Update
  • Install all updates

Powershell Execution Policy:

  • launch Windows Powershell as administrator and execute:
/* ===========================================================================
*
* LIBRARY
*
* =========================================================================== */
/* Proof of Concept GUI:
* - PoC UI implementation in ~2.5kLOC of C89 (ANSI C)
* => Core solutions has no external dependencies (removing standard library dependency is trival)
* => Does not use or require any special language constructs or macro constructs just pointers and enums
* - Combines both "retained" and "immediate mode" UI by providing control over update frequency
@djg
djg / reading-list.md
Last active February 19, 2024 18:09
Fabian's Recommened Reading List
#!/bin/bash
# If we get interrupted, make sure to kill the whole process tree
trap 'trap - SIGTERM && kill 0' SIGINT SIGTERM
# Issue command to all devices in parallel
for DEVICE in `adb devices | awk '/\tdevice$/ { print $1 }'`; do
ANY_DEVICES=1
# Look up pretty name from serial number
@pervognsen
pervognsen / x64_emitter.cpp
Created May 14, 2016 20:31
x64 machine code emitter
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <windows.h>
#include <stdint.h>
#define Assert(x) \
if (!(x)) { MessageBoxA(0, #x, "Assertion Failure", MB_OK); __debugbreak(); }
enum Register {
RAX = 0,