Skip to content

Instantly share code, notes, and snippets.

View PQCraft's full-sized avatar
🐧
I use Arch BTW

PQCraft PQCraft

🐧
I use Arch BTW
View GitHub Profile
@fabianoriccardi
fabianoriccardi / Comparison Espressif ESP MCUs.md
Last active August 18, 2024 07:29
Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

A minimal table to compare the Espressif's MCU families. The reported specifications are referred to the SoC, not to the modules (silver shield).

ESP8266 ESP32 ESP32-S2 ESP32-S3 ESP32-C3 ESP32-C6
Announcement Date 2014, August 2016, September
@YukiSnowy
YukiSnowy / main.cpp
Last active September 14, 2024 04:53
example SDL2 Direct3D9 application
// g++ *.cpp -o d3d9 -lmingw32 -lSDL2main -lSDL2 -I/dxsdk/include -L/dxsdk/lib -DUNICODE -ld3d9 -ld3dx9
// http://blog.fourthwoods.com/2011/08/11/setting-up-mingw-for-directx/
// http://www.directxtutorial.com/Lesson.aspx?lessonid=9-4-4
#include <iostream>
using namespace std;
#include <SDL2/SDL.h>
#include <windows.h>
@tilkinsc
tilkinsc / assimp_opengl_load.c
Created September 8, 2017 08:52
Pure C Assimp model file loading example
VAO* load_model(const char* path) {
// import model
const struct aiScene* scene = aiImportFile(path, aiProcess_Triangulate); // http://assimp.sourceforge.net/lib_html/structai_scene.html
if(scene->mNumMeshes <= 0) {
aiReleaseImport(scene);
return 0;
}
struct aiMesh* mesh = *scene->mMeshes; // http://assimp.sourceforge.net/lib_html/structai_mesh.html
Frustum Camera::CalculateFrustum(float fnear, float ffar) {
Frustum returnFrustum;
// Calculate the near and far plane points
float nearHeight = 2 * tan(fov / 2) * fnear;
float nearWidth = nearHeight * aspect;
float farHeight = 2 * tan(fov / 2) * ffar;
float farWidth = farHeight * aspect;
// And their centers
@bkaradzic
bkaradzic / orthodoxc++.md
Last active September 18, 2024 17:03
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++?

@c9n
c9n / rsa_demo.c
Created November 17, 2015 13:04
openssl RSA demo
#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <openssl/err.h>
#include <stdio.h>
#include <string.h>
#define KEY_LENGTH 2048
#define PUB_EXP 3
#define PRINT_KEYS
#define WRITE_TO_FILE