Skip to content

Instantly share code, notes, and snippets.

View perezite's full-sized avatar

Simon perezite

View GitHub Profile
@kklouzal
kklouzal / LuaClassBinding.cpp
Created November 2, 2017 23:41
Binding A C++ Class To Lua The Manual Way (shared_ptr memory management)
#include <lua.hpp> // LuaJIT header
#include <iostream> // Access to std::system("PAUSE")
#include <memory>
// A simple class to be bound in our Lua environment.
class MyClass
{
public:
MyClass()
{
@fenbf
fenbf / sfinae_tostring_ex.cpp
Created February 9, 2016 20:33
C++ SFINAE example: how to detect if a class contains ToString method
// SFINAE, enable_if example
// based on http://stackoverflow.com/questions/257288/is-it-possible-to-write-a-c-template-to-check-for-a-functions-existence
#include <iostream>
#include <type_traits>
class ClassWithToString
{
public:
@paniq
paniq / ecs.md
Last active September 5, 2025 13:28
Entity Component Systems
@ruby0x1
ruby0x1 / main.cpp
Last active January 4, 2019 21:09
SDL2 sample
//SDL2 flashing random color example
//Should work on iOS/Android/Mac/Windows/Linux
#include <SDL.h>
#include <SDL_opengl.h>
#include <stdlib.h> //rand()
static bool quitting = false;
static float r = 0.0f;
@iondune
iondune / SimpleOpenGL.cpp
Created January 28, 2015 19:28
Simple OpenGL sample using GLEW and GLFW
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <string>
void PrintOpenGLErrors(char const * const Function, char const * const File, int const Line)
{
@Youka
Youka / lua_myobject.cpp
Last active August 27, 2024 06:32
Example of Lua in C++ and userdata objects
// Lua C API
#include <lua.hpp>
// C++ input/output streams
#include <iostream>
// MyObject as C++ class
class MyObject{
private:
double x;
public:
@darkdukey
darkdukey / Android.mk
Last active December 10, 2022 14:31
NDK build include all the files under a directory
#traverse all the directory and subdirectory
define walk
$(wildcard $(1)) $(foreach e, $(wildcard $(1)/*), $(call walk, $(e)))
endef
#find all the file recursively under jni/
ALLFILES = $(call walk, $(LOCAL_PATH))
FILE_LIST := $(filter %.cpp, $(ALLFILES))
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
@staltz
staltz / introrx.md
Last active October 21, 2025 16:32
The introduction to Reactive Programming you've been missing
@in4lio
in4lio / coroutine.h
Last active May 7, 2021 02:51
Coroutines in C
/**
* \file coroutine.h
* \brief Coroutines in C.
* \author Vitaly Kravtsov (in4lio@gmail.com)
* \copyright The MIT License
*
* Coroutine mechanics, implemented using the C language extension "Labels as Values".
* Based on Simon Tatham "Coroutines in C".
*/
@rxaviers
rxaviers / gist:7360908
Last active October 21, 2025 13:18
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue: