Skip to content

Instantly share code, notes, and snippets.

@maxtruxa
maxtruxa / Antonyms.md
Last active May 6, 2024 09:31
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
@maxtruxa
maxtruxa / tmux-cheat-sheet.md
Last active December 11, 2023 13:06
tmux cheat sheet
@maxtruxa
maxtruxa / Makefile
Last active August 31, 2023 14:56
Generic makefile for C/C++ with automatic dependency generation, support for deep source file hierarchies and custom intermediate directories.
# output binary
BIN := test
# source files
SRCS := \
test.cpp
# files included in the tarball generated by 'make dist' (e.g. add LICENSE file)
DISTFILES := $(BIN)
@maxtruxa
maxtruxa / type_name.hpp
Created December 16, 2022 18:51
Get the pretty typename of any C++ type at compile time. Demo: https://godbolt.org/z/vsaKsecW6
#include <string_view>
template <typename T>
#if __cpp_consteval
consteval
#else
constexpr
#endif
auto type_name() {
#ifdef __clang__
@maxtruxa
maxtruxa / BrainFuck.cpp
Last active November 28, 2017 00:56
C++ BrainFuck Interpreter
#include <iostream>
#include <fstream>
#include <vector>
#include <Windows.h> // MessageBox
size_t const DATA_SIZE_START = 0x0000400; // 1 KiB
size_t const DATA_SIZE_MAX = 0x1000000; // 16 MiB
enum token_t : char
{
@maxtruxa
maxtruxa / Trace.h
Last active April 7, 2017 06:43
Common tracing definitions for Windows drivers. #windows #driver
//
// The MIT License (MIT)
//
// Copyright (c) 2013-2014 Max Truxa
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
@maxtruxa
maxtruxa / index.html
Created August 24, 2016 09:15
sch-sz.de
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Rezepte C&amp;C</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<style>
.no-padding {
@maxtruxa
maxtruxa / sudoku.cpp
Created January 10, 2014 05:46
Simple Sudoku solver. #cpp #cli
//
// The MIT License (MIT)
//
// Copyright (c) 2013 Max Truxa
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
@maxtruxa
maxtruxa / hstart.c
Last active December 30, 2015 20:49
CLI utility for Windows that can start a process hiding it's window. #c #windows #cli
//
// The MIT License (MIT)
//
// Copyright (c) 2013 Max Truxa
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
#include "perlin_noise.hpp"
#include <numeric>
#include <random>
namespace detail {
namespace perlin_noise {
double fade(double t)
{
return t * t * t * (t * (t * 6 - 15) + 10);