Skip to content

Instantly share code, notes, and snippets.

maxtruxa / type_name.hpp
Created December 16, 2022 18:51
Get the pretty typename of any C++ type at compile time. Demo:
#include <string_view>
template <typename T>
#if __cpp_consteval
auto type_name() {
#ifdef __clang__
maxtruxa /
Last active December 11, 2023 13:06
tmux cheat sheet
maxtruxa / index.html
Created August 24, 2016 09:15
<!DOCTYPE html>
<html lang="de">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Rezepte C&amp;C</title>
<link rel="stylesheet" href="" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
.no-padding {
maxtruxa / Makefile
Last active May 12, 2024 21:49
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 := \
# files included in the tarball generated by 'make dist' (e.g. add LICENSE file)
#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);
#include "StdAfx.h"
#include <cmath>
: _x{}, _y{}, _error{}, _first_iteration{} { }
void bresenham_line::initialize(point_t const& start, point_t const& end)
this->initialize(start.X, start.Y, end.X, end.Y);
maxtruxa / broken_vcxx.cpp
Last active August 29, 2015 14:23
VC++ bug: std::unique_ptr with std::is_same<element_type, pointer>::value == true
#include <iostream>
#include <memory>
int main() {
struct my_type {
void poke() { std::cout << "poke\n"; }
typedef my_type* my_type_ptr;
struct my_deleter {
template<typename TMapIterator>
class key_iterator : public TMapIterator
typedef typename TMapIterator::value_type::first_type key_type;
key_iterator() : TMapIterator() { }
key_iterator(TMapIterator iter) : TMapIterator(iter) { }
key_type* operator->()

Example Paths

Examples below use the following paths:

Windows Posix
C:\Foo\Bar\ /foo/bar/

Path Decomposition

maxtruxa /
Last active June 18, 2024 18:39
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