Skip to content

Instantly share code, notes, and snippets.

Avatar

rubenwardy rubenwardy

View GitHub Profile
View minetest_monthly.csv
Date Opened Closed New Contributors
2011-08-01 1 0 1
2011-09-01 9 5 7
2011-10-01 3 0 2
2011-11-01 5 1 3
2011-12-01 6 0 5
2012-01-01 6 5 3
2012-02-01 4 6 3
2012-03-01 4 9 3
2012-04-01 4 6 4
View gpt_counter.lua
-- Store a counter that increments each time a player joins
local file = minetest.get_worldpath().."/counter"
local f = io.open(file, "r")
if f==nil then
counter = 0
else
counter = tonumber(f:read("*all"))
f:close()
end
View cdb_featured.md
View test_script.cpp
Test(ModOrderResolverRedundantTests) {
std::vector<ModConfig> mods;
mods.push_back({
"modB",
"rubenwardy",
"",
std::vector<std::string>{"modC"}
});
mods.push_back({
View LuaSecurity.cpp
#include <fstream>
#include <scripting/ModException.hpp>
#include <sanity.hpp>
#include "LuaSecurity.hpp"
using namespace scripting;
namespace {
void copyAll(sol::environment &env, const sol::global_table &globals,
View discord_bt.txt
(gdb) thread apply all bt
Thread 34 (Thread 0x7fffe3fe7700 (LWP 4588)):
#0 0x00007ffff781ccf5 in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1 0x0000555558b06b0b in ()
#2 0x0000555558ad9100 in ()
#3 0x0000555558d50400 in ()
#4 0x00000327f38604a2 in ()
#5 0x000024d200000101 in ()
#6 0x7fffffffffffffff in ()
View DropShadow.cpp
#include "DropShadow.hpp"
#include <cassert>
#include <cmath>
#include <memory>
using namespace sfext;
namespace {
std::unique_ptr<sf::Shader> shadowShader;
View keybase.md

Keybase proof

I hereby claim:

  • I am rubenwardy on github.
  • I am rubenwardy (https://keybase.io/rubenwardy) on keybase.
  • I have a public key ASBExTr0_r9rJ7-9Tt46Dt6-SzPEiwihDVWqfz-wI3Gp0wo

To claim this, I am signing this object:

@rubenwardy
rubenwardy / sol_JSON.cpp
Last active March 2, 2020 00:38
Sol3 Read/parse JSON from file or string
View sol_JSON.cpp
#include <json/json.h>
#include <fstream>
#include <sstream>
namespace {
sol::object json_to_lua(Json::Value value, sol::this_state state) {
switch (value.type()) {
case Json::nullValue:
return sol::nil;
View pipeline.lua
-- Run a series of functions as a pipeline - each returning the next's arguments.
--
-- The first function will be ran immediately
--
-- @param interval Time between pipelines
-- @param funcs A list of functions, each one of the form function(...)
-- where ... is returned by the previous function.
-- @param params Optional, a list of arguments to pass to the first function
local function pipeline(interval, funcs, params)
if funcs[1] ~= nil then