Skip to content

Instantly share code, notes, and snippets.

@leafi
leafi / log.txt
Created April 25, 2018 19:17
node-lz4 Node 10 test failures
pink:node-lz4 leaf$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
pink:node-lz4 leaf$ node --version
v10.0.0
pink:node-lz4 leaf$ npm i && npm test
npm WARN deprecated connect@2.30.2: connect 2.x series is deprecated
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
@leafi
leafi / binpack_example.lua
Created February 28, 2018 15:44
binpack_example.lua for binpack.lua MAXRECTS
local binpack_new = require('binpack')
local bp = binpack_new(2048, 2048)
local rect1 = bp:insert(32, 64)
-- (rect1 has .x, .y, .w, .h, :clone(), :contains(rect), .right, .bottom)
print('rect1:', rect1) -- rect1: {x=0,y=0,w=32,h=64}
local rect2 = bp:insert(100, 101)
print('rect2:', rect2) -- rect2: {x=0,y=64,w=100,h=101}
@leafi
leafi / binpack.lua
Last active August 1, 2023 19:03
binpack.lua (MAXRECTS)
-- binpack.lua
--
-- Based on SharpFont BinPacker.cs (c) 2015 Michael Popoloski, licensed under MIT
-- https://github.com/MikePopoloski/SharpFont/blob/master/SharpFont/Internal/BinPacker.cs
--
-- Uses MAXRECTS method developed by Jukka Jylänki http://clb.demon.fi/files/RectangleBinPack.pdf
--
-- Does not support rotating rectangles for better fitting.
-- Does not support dynamic spritesheet sizes; you must pick a size up-front
--
@leafi
leafi / keybase.md
Created February 13, 2018 04:11
keybase.md

Keybase proof

I hereby claim:

  • I am leafi on github.
  • I am leafi (https://keybase.io/leafi) on keybase.
  • I have a public key ASCljZw5ZXhuT71tx0f5TvRZsKawez24DXf0xnWxVWeiYgo

To claim this, I am signing this object:

@leafi
leafi / change-PKGBUILD-prepare-to-be-like-this.txt
Created July 13, 2016 15:23
Truly terrible patches to fix CoreCLR & CoreFX build on Arch Linux
prepare() {
cd "${srcdir}/${_coreclr}"
patch -p1 < "${srcdir}/gcc6-github-pull-5304.patch"
patch -p1 < "${srcdir}/segv-github-pull-6027.patch"
patch -p1 < "/home/leaf/unused-attr-write-coreclr.patch"
cd "${srcdir}/${_corefx}"
patch -p1 < "/home/leaf/unused-attr-write-corefx.patch"
}
@leafi
leafi / gist:9cac45df526be3625e8a
Last active August 29, 2015 14:18
to_variants.lua
--Assertion: all 'functions =' lines are either:
-- functions = {
--or:
-- functions = {
--...EXCEPT those representing module functions, where it's:
-- functions = {
--or:
-- functions = {
-- The first 'special' module functions line should only happen once per file.