Skip to content

Instantly share code, notes, and snippets.

View gjroelofs's full-sized avatar

Gijs-Jan Roelofs gjroelofs

View GitHub Profile
public class MyGdxGame extends ApplicationAdapter {
public PerspectiveCamera cam;
public ModelBatch modelBatch;
public Model model;
public ModelInstance instance;
@Override
public void create() {
modelBatch = new ModelBatch();
@gjroelofs
gjroelofs / UnityErrors.cs
Created January 16, 2016 14:53
Internal Compiler Errors in Unity
public static class ExtensionTests {
public static void Test(this object target, float a, float b = 1, float c = 2, float d = 3) { }
}
object target = null;
// Compiles
target.Test(0);
public class FooAttribute : Attribute {}
public class Target {
[Foo]
public void Interesting(){}
public void NotInteresting(){}
}
/* Hide description badge */
.badge.is-icon-only {
display: none;
}
/* Make ID smaller */
.card-short-id.hide, .card-short-id {
display: inline-block !important;
font-size: 10px;
font-weight: bold;
"Its not the bananas. I'm a bad conductor."
.card_view--root--1ItV2NTu {
transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
position: relative;
box-sizing: border-box;
width: 100%;
background: white;
cursor: default;
padding: 5px;
}
@gjroelofs
gjroelofs / JS TOC - Coda
Last active October 14, 2019 10:49
Javascript injection hack to create a TOC for Coda, also see: https://gist.github.com/gjroelofs/8cd6d0908ac72783ec97bbf7e0c91ef0 for CSS
/** Table of Contents **/
var AUTOGENERATED_TABLE_OF_CONTENTS = true;
var TOC_ID_PREFIX = "auto_toc_";
var canvasSection = ".document--root--MUOgORi0";
var codeH1 = ".kr-h1";
var codeH2 = ".kr-h2";
var codeH3 = ".kr-h3";
/* Ensure that cards without images don't reserve space for them. */
.card_view--root--1ItV2NTu .card_view--mediaTop--3m6a0XK2 {
box-sizing: border-box;
height: 100%;
margin-left: auto;
margin-right: auto;
padding: 0px;
}
@gjroelofs
gjroelofs / JS Move Menu Coda Bottom
Last active October 31, 2019 12:58
Coda move header menu to the bottom
/*************** Move header to the bottom **************/
$(document).arrive(".title_bar--root--KjDBqrRl", function() {
$(this).appendTo($(this).parent());
});
@gjroelofs
gjroelofs / Grid
Last active February 27, 2020 17:08
Burst & Grid
Problem:
Concept of entities with volume that define different characteristics which need
to be volume tested against for various gamelogic purposes. Previous iteration
was a grid implementation where these characteristics were represented as
bitflags, each `int` a gamelogic concept to be tested against. E.g. Pathing:
[None, Impassable, Occupied, Walkable, Flyable, Vaultable, Climbable,
Interactable, Teleporter, Staircase]
Any volume placed on the grid would OR added to the grid's characteristics
bitmasks of the cells it occupied.