Skip to content

Instantly share code, notes, and snippets.

View Benjamin-Dobell's full-sized avatar

Benjamin Dobell Benjamin-Dobell

View GitHub Profile
StringsAndComments
{
Unicode { string { "💩", "🙉: Hear no evil monkey is strǽnge", "Yes, a sickle - ☭: ☭" } }
}
Coordinates $where
{
int32[3] %xyz
{
{ 1, 2, 3 },
@Benjamin-Dobell
Benjamin-Dobell / gist:bb7ae216036c7e5641b3731fafa2598c
Last active June 29, 2017 12:33
End of financial year logs
LOG_DIR=~/EOFY/2016-2017/
mkdir -p $LOG_DIR
for dir in */ ; do
cd $dir
if git log &> /dev/null; then
project=$(basename $dir)
for branch in $(git for-each-ref --format='%(refname:strip=2)' refs/heads/); do
LOG=$(git log $(git merge-base master $branch)..$branch --since="2016-07-01T00:00:00+10:00")
if [ -n "$LOG" ]; then
echo $LOG > $LOG_DIR/$project.$branch.log
➜ HMM git clone git@github.com:Benjamin-Dobell/regenerator.git
Cloning into 'regenerator'...
remote: Counting objects: 3592, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3592 (delta 1), reused 1 (delta 1), pack-reused 3589
Receiving objects: 100% (3592/3592), 4.31 MiB | 1.98 MiB/s, done.
Resolving deltas: 100% (2275/2275), done.
➜ HMM cd regenerator
➜ regenerator git:(master) git checkout -b fix-csp origin/fix-csp
Branch 'fix-csp' set up to track remote branch 'fix-csp' from 'origin'.
@Benjamin-Dobell
Benjamin-Dobell / Diabolical
Last active August 29, 2018 05:57
Pfft, crashes are for chumps
static jmp_buf jmpEnv;
enum {
kPrepareBinaryAddress = 0x44dd,
kMutexBinaryAddress = 0x9090
};
void signal_handler(int n, siginfo_t *info, void *context)
{
longjmp(jmpEnv, 1);
@Benjamin-Dobell
Benjamin-Dobell / ContainerEventsFix.ttslua.lua
Created September 30, 2018 22:03
TTS onObjectEnterContainer work around
-- We use onCollisionEnter (requires InstanceCollisionProxy be included in Card scripts) and onUpdate event handlers as a hacky work-around for
-- onObjectEnterContainer not firing when it should. For this to work reliably we must be the first subscriber to the onObjectDestroy event.
-- Bug report: http://www.berserk-games.com/forums/showthread.php?5461-onObjectEnterContainer-never-fires-for-bottom-card
ge_tts_package('ge_tts/ContainerEventsFix', function()
local Logger = ge_tts_require('ge_tts/Logger')
local EventManager = ge_tts_require('ge_tts/EventManager')
local frameCardObjectCollisions = {}
local frameCardObjectEnteredDecks = {}
#!/usr/bin/env bash
set -e
BASE_DIR=$(dirname $0)
DISABLE_SAVE=false
EMPTY_GAME=false
RELEASE=false
require 'lua-compile/cyclic'
math.randomseed(os.time())
---@type prototype_inertia__Debug
local Debug = require('Debug')
---@type ge_tts__Http
local Http = require('ge_tts/Http')
@Benjamin-Dobell
Benjamin-Dobell / JSON.lua
Created March 19, 2019 13:28
JSON.lua version included in TTS as of 2019-03=20
-- -*- coding: utf-8 -*-
--
-- Simple JSON encoding and decoding in pure Lua.
--
-- Copyright 2010-2014 Jeffrey Friedl
-- http://regex.info/blog/
--
-- Latest version: http://regex.info/blog/lua/json
--
-- This code is released under a Creative Commons CC-BY \"Attribution\" License:
This file has been truncated, but you can view the full file.