Skip to content

Instantly share code, notes, and snippets.

View bramtechs's full-sized avatar
🐺

brambasiel bramtechs

🐺
View GitHub Profile
@jordandee
jordandee / sdl2_opengl.cpp
Last active October 14, 2024 13:12
Simple SDL2/OpenGL example
// To compile with gcc: (tested on Ubuntu 14.04 64bit):
// g++ sdl2_opengl.cpp -lSDL2 -lGL
// To compile with msvc: (tested on Windows 7 64bit)
// cl sdl2_opengl.cpp /I C:\sdl2path\include /link C:\path\SDL2.lib C:\path\SDL2main.lib /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libcmtd.lib opengl32.lib
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
@theratman
theratman / change_filename_to_md5.sh
Last active June 18, 2023 20:04
Rename files to md5 sum plus extension
#!/bin/bash
# For Mac OS X version (md5)
MD="md5 -r"
# For Linux version (md5sum)
MD="md5sum"
for i in ./*; do
mv "${i}" "./$($MD "$i" | awk '{print $1}').${i##*.}"
@williamdes
williamdes / base64_encode_decode.cpp
Created June 20, 2017 16:40
c++ 11 encoding and decoding base64
//FROM
//https://stackoverflow.com/a/34571089/5155484
typedef unsigned char uchar;
static const std::string b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";//=
static std::string base64_encode(const std::string &in) {
std::string out;
int val=0, valb=-6;
for (uchar c : in) {
@nmarley
nmarley / README.md
Last active September 24, 2024 08:12
Go / C++ bindings example

Go / C++ bindings example

This is an example of Go code calling to a C++ library with a C wrapper.

Build

go build  # this only ensures it compiles