Skip to content

Instantly share code, notes, and snippets.

View pakeke-constructor's full-sized avatar
🤓

Oli Garrett pakeke-constructor

🤓
View GitHub Profile
@torcado194
torcado194 / cleanEdge-shadertoy.glsl
Last active September 7, 2024 04:36
cleanEdge, a pixel art upscaling algorithm for clean rotations
/*** MIT LICENSE
Copyright (c) 2022 torcado
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
@RyanPattison
RyanPattison / alias_table.lua
Last active March 31, 2024 00:31
A Lua implementation of the Alias Method, for sampling from an arbitrary distribution.
local alias_table = {}
function alias_table:new(weights)
local total = 0
for _,v in ipairs(weights) do
assert(v >= 0, "all weights must be non-negative")
total = total + v
end
assert(total > 0, "total weight must be positive")
@aras-p
aras-p / preprocessor_fun.h
Last active September 8, 2024 07:43
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,