Skip to content

Instantly share code, notes, and snippets.

View gist:59012b2a3d4dcdb40b5247ecdc2cfb34
eevee / potluck.js
Created May 12, 2017
initial crack at potluck with pixi, because someone asked
View potluck.js
window.Potluck = {};
let _index_to_coords = function(index, columns) {
return [index % columns, Math.floor(index / columns)];
Potluck.begin = function() {
let renderer = PIXI.autoDetectRenderer(800, 600);
View famicube64-canon-order.pal
0 0 0
0 23 125
2 74 202
0 132 255
91 168 255
152 220 255
155 160 239
eevee /
Created Mar 23, 2017
Python script to convert exported JavaScript back into a PICO-8 cartridge
import os.path
import re
import sys
# LZ-ish decompression scheme borrowed from picolove:
compression_map = b"\n 0123456789abcdefghijklmnopqrstuvwxyz!#%(){}[]<>+=/*:;.,~_"
def decompress(code):
lua = bytearray()
eevee / collision.lua
Created Mar 19, 2017
tile-based pico8 collision i wrote in like an hour or two
View collision.lua
platscene = {
xaccel = 0.5,
xmax = 2,
gravity = 0.5,
ymax = 16,
function platscene:switch()
self.mapbbox = {0, 0, 16, 16}
self.playerbbox = {
0, 0,
eevee /
Created Mar 14, 2017
weird-ass rust problem
enum IResult<I, O, E = u32> {
Done(I, O),
fn foo(input: &[u8]) {
if let IResult::Done(i, o) = IResult::Done(input, input) {}
eevee /
Created Dec 15, 2016
Find the nearest/furthest actor from a source in ZDoom DECORATE

I needed a monster to set the nearest corpse as its target, but the same idea could be adapted to anything else easily enough.

  1. Clear the source's target. Set some user var on the source, user_closest_target, to a null-ish value like -1.

  2. Use A_RadiusGive from the source to give a dummy inventory item to every candidate actor.

  3. From the inventory item, call an ACS script.

  4. In the ACS script (where the candidate is the activator), check the distance from the candidate to the source via GetActorX, GetActorY, and VectorLength. If that distance is closer than user_closest_target (or user_closest_target is -1, meaning this is the first candidate checked), update user_closest_target and set the source's target to this candidate.

eevee /
Last active Dec 15, 2016
Twitter bugs and inconsistencies and general weirdness

Twitter bugs and inconsistencies and general weirdness

Derived in part from my attempt at a comprehensive list of the rules, which is probably out of date by now:

Tweets and replies

  • Poll options on web Twitter do not render emoji with Twemoji. They're left as plain text.

  • On web Twitter, typing several capital letters in a row tends to bring up a user suggestion dropdown. I guess the idea is that a word starting with a capital letter is likely to be a name, but the behavior seems erratic and unpredictable. It has never once been useful to me — if I want to mention someone, the first thing I type is @.

eevee /
Created Nov 11, 2016
intercepting attribute assignment
class InterceptableAttribute:
def __init__(self, name, *twiddles):
self.twiddles = twiddles
# NOTE: this call and the 'name' arg will no longer be necessary in
# Python 3.6
self.__set_name__(None, name)
def __set_name__(self, owner, name): = name
eevee /
Created Sep 21, 2016
notes on remaining work on 3d floors
  • 3d floors
    • somewhat critical problem: ordering 3d floors by height means that the selection changes if you mousewheel the height above/below another floor
      • maybe i should get rid of the duplicated extra_floor_t struct and instead give each sector just a list of the control sectors, then identify by those instead of index?
      • could still stay sorted, even
      • it IS possible to have the same control sector mapped to two 3d floors, though. but is that ever useful??
      • i really wish i had faux flat/wall objects
        • i REALLY WISH i could just pass around sector pointers and bail if they're bogus??
    • can't highlight or select an inner flat of a 3d floor
    • mousewheel to change a regular ceiling height is super slow in my dump3 map; i think the full mapspecials thing is too expensive
      • may need to do actual incremental updates in this branch, right now! OH NO