Skip to content

Instantly share code, notes, and snippets.

@meseta
meseta / Logger.gml
Last active December 23, 2023 22:40
GML Structured Logger
/** A logger instance that can be used for writing log messages
* @param {String} _name The logger's name. This will appear in any log messages produced by this logger
* @param {Struct} _bound_values Optional struct of bound values which will be included in all log messages produced by this logger
* @param {Struct.Logger} _root_logger The loot logger instance that is this logger's parent
* @author Meseta https://meseta.dev
*/
function Logger(_name="logger", _bound_values=undefined, _root_logger=undefined) constructor {
/* @ignore */ self.__name = _name;
/* @ignore */ self.__bound_values = (is_struct(_bound_values) ? _bound_values : {});
/* @ignore */ self.__file_handle = -1;
@nkrapivin
nkrapivin / gist:f3118d1396000979db1f2c2eaf43309e
Last active November 26, 2021 18:33
undocumented debug_event stuff
some may only work on Linux, or only on consoles...
usage: debug_event("thing here");
DumpMemory - prints the amount of allocated memory to console (Total memory used 0xblabla bytes)
CheckGLError - I assume it's supposed to ignore OpenGL errors? But it seems to be unused lol.
VMTraceOn - sets g_fVMDebug to true
VMTraceOff - sets that variable to false
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active June 13, 2024 04:20
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
// Addition to jQuery to get the inner text width
$.fn.textWidth = function(){
var text = $(this).html();
$(this).html('<span>'+text+'</span>');
var width = $(this).find('span:first').width();
$(this).html(text);
return width;
};