Skip to content

Instantly share code, notes, and snippets.

@SteveShaw
SteveShaw / zmq-publisher.cpp
Created January 11, 2021 04:17 — forked from hmartiro/zmq-publisher.cpp
ZeroMQ pub/sub usage and latency timing for C++11
/**
* Example of ZeroMQ pub/sub usage for C++11.
*/
#include <zmqpp/zmqpp.hpp>
#include <iostream>
#include <chrono>
#include <thread>
using namespace std;
@SteveShaw
SteveShaw / french_grammar.txt
Created October 15, 2020 16:41
French grammar
1. Forming subjunctive
@SteveShaw
SteveShaw / cppcon_20.txt
Last active November 24, 2020 03:06
CppCon 20 notes
1. Generic Identity MetaFunction( C++ 17)
2. Dynamic Polymorphism with Metaclasses and Code Injection
@SteveShaw
SteveShaw / calling_lua_function_with_return.cpp
Created August 26, 2020 20:02
calling lua function inside c++ example
int LinearIndex(lua_State*L, int row, int col) {
// Push the GetIndex function on the stack
lua_getglobal(L, "GetIndex");
// Stack: function (GetIndex)
// Push the row variable on the stack
lua_pushnumber(L, row);
// Stack: function (GetIndex), int (row)
// Push the col variable on the stack
@SteveShaw
SteveShaw / lua_coroutine.cpp
Created August 25, 2020 21:11
Asynchronous Lua functions
#include <iostream>
#include <lua.hpp>
using namespace std;
class Lua
{
private:
lua_State* m_pLuaState{ nullptr };
bool m_IsThread{ false };
@SteveShaw
SteveShaw / call_cfunc_lua.cpp
Created August 25, 2020 21:02
Calling C Functions from Lua
#include <iostream>
#include "lua.hpp"
#include <vector>
using namespace std;
namespace
{
int Sum(lua_State *L)
{
@SteveShaw
SteveShaw / lua_table.cpp
Created August 25, 2020 20:47
Creating a Lua Table in C++
#include <iostream>
#include "lua.hpp"
#include <vector>
using namespace std;
class Lua
{
private:
lua_State* m_pLuaState{ nullptr };
@SteveShaw
SteveShaw / calling_lua.cpp
Created August 25, 2020 20:44
Calling Lua function
#include <iostream>
#include "lua.hpp"
using namespace std;
class Lua
{
private:
lua_State* m_pLuaState{ nullptr };
@SteveShaw
SteveShaw / french.txt
Created August 18, 2020 19:54
French input (Canada)
à - \ (the key above "Enter", "|" is also shown on it)
â - [, a (the key right of "P", then "a")
æ - RCtrl+a (Right-Ctrl together with "a"; Note: Left-Ctrl will not work)
ç - ] (the key above "Enter")
è - ' (the key left of "Enter", """ is also shown on it)
é - / (the key left of Right-Shift, "?" is also shown on it)
ê - [, e (the key right of "P", then "e")
ë - {, e (Shift together with [, then "e")
î - [, i (the key right of "P", then "i")
ï - {, i (Shift together with [, then "i")