Skip to content

Instantly share code, notes, and snippets.

View karimnaaji's full-sized avatar

Karim Naaji karimnaaji

View GitHub Profile
@bkaradzic
bkaradzic / orthodoxc++.md
Last active November 17, 2024 00:54
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@tallytalwar
tallytalwar / .vim
Last active March 26, 2018 19:04
.vimrc and plugins (using pathogen)
We couldn’t find that file to show.
/*
clang++-3.6 -DVARIADIC_WRAPPER -O3 -Wall -Wpedantic -std=c++11 variadic.cpp
./a.out
objdump -j .rodata -j .text -d -S a.out > a.txt
clang++-3.6 -O3 -Wall -Wpedantic -std=c++11 variadic.cpp
./a.out
objdump -j .rodata -j .text -d -S a.out > b.txt
@tallytalwar
tallytalwar / c++ tricks
Last active September 25, 2016 01:20
Fast std::vector removal when order is not a priority
We couldn’t find that file to show.
@rmarianski
rmarianski / anonstruct.c
Created December 29, 2014 15:41
Embed structures in c
#include <stdio.h>
typedef struct point {
int x, y;
} point;
typedef struct point3d {
struct point;
int z;
} point3d;
@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active October 13, 2024 16:49
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;
@castano
castano / hemicube.cpp
Created June 20, 2014 09:46
Hemicube Integrator
#include "hemicube.h"
#define PACK_HEMICUBES 1
static void get_hemicube_face_normal(int index, Vector3 *forward, Vector3 *left, Vector3 *up) {
// Unwrapped hemicube with positive-Z in the middle.
switch (index) {
case 0: *forward = Vector3(+1, 0, 0); *left = Vector3( 0, 1, 0); break;