Skip to content

Instantly share code, notes, and snippets.

View jeremyong's full-sized avatar
⌨️

Jeremy Ong jeremyong

⌨️
View GitHub Profile
@jeremyong
jeremyong / State.h
Last active January 2, 2016 21:48
First pass
#pragma once
namespace sel {
class State {
private:
lua_State *_l;
public:
State() : _l(nullptr) { _l = luaL_newstate(); }
State(const Luab &other) = delete;
State &operator=(const Luab &other) = delete;
@jeremyong
jeremyong / main.cpp
Last active January 2, 2016 21:39
Improved call to a lua function using Luab
#include <string>
#include <cassert>
#include "selene.h"
int main() {
sel::State state;
l.Load("example.lua")
int difference;
std::string greeting;
@jeremyong
jeremyong / example.lua
Created January 11, 2014 00:10
Simple lua file
function subtract_and_hello(a, b)
return a - b, "hello"
end
@jeremyong
jeremyong / main.cpp
Last active January 2, 2016 21:39
sample function call to lua file
#include <string>
#include <cassert>
extern "C" {
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
int main() {
lua_State *l = luaL_newstate();

Keybase proof

I hereby claim:

  • I am jeremyong on github.
  • I am jeremyong (https://keybase.io/jeremyong) on keybase.
  • I have a public key whose fingerprint is 6B25 C16A 09DF D412 7252 7078 FAEB 4053 B50B 0549

To claim this, I am signing this object: