Skip to content

Instantly share code, notes, and snippets.

View gist:59012b2a3d4dcdb40b5247ecdc2cfb34
@__mote
@aBinaryTernary
@ach_crvens
@amymist
@BarryBenson2007
@bulbasort
@BushytailSkwirl
@doniamae
@eevee
@eltoraz
@eevee
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);
document.body.appendChild(renderer.view);
View famicube64-canon-order.pal
JASC-PAL
0100
65
0 0 0
0 23 125
2 74 202
0 132 255
91 168 255
152 220 255
155 160 239
@eevee
eevee / pico8jstocart.py
Created Mar 23, 2017
Python script to convert exported JavaScript back into a PICO-8 cartridge
View pico8jstocart.py
import os.path
import re
import sys
# LZ-ish decompression scheme borrowed from picolove:
# https://github.com/gamax92/picolove/blob/master/cart.lua
compression_map = b"\n 0123456789abcdefghijklmnopqrstuvwxyz!#%(){}[]<>+=/*:;.,~_"
def decompress(code):
lua = bytearray()
@eevee
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
eevee / busted.rs
Created Mar 14, 2017
weird-ass rust problem
View busted.rs
enum IResult<I, O, E = u32> {
Done(I, O),
Error(E),
}
fn foo(input: &[u8]) {
if let IResult::Done(i, o) = IResult::Done(input, input) {}
}
@eevee
eevee / untitled.md
Created Dec 15, 2016
Find the nearest/furthest actor from a source in ZDoom DECORATE
View untitled.md

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
eevee / twitterbugs.md
Last active Dec 15, 2016
Twitter bugs and inconsistencies and general weirdness
View twitterbugs.md

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: https://eev.ee/blog/2016/02/20/twitters-missing-manual/

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
eevee / value.py
Created Nov 11, 2016
intercepting attribute assignment
View value.py
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):
self.name = name
@eevee
eevee / 3dfloors-notes.md
Created Sep 21, 2016
notes on remaining work on 3d floors
View 3dfloors-notes.md
  • 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