Skip to content

Instantly share code, notes, and snippets.

View eevee's full-sized avatar
🦊

Eevee eevee

🦊
View GitHub Profile
@eevee
eevee / pico8jstocart.py
Created March 23, 2017 12:14
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:
# https://github.com/gamax92/picolove/blob/master/cart.lua
compression_map = b"\n 0123456789abcdefghijklmnopqrstuvwxyz!#%(){}[]<>+=/*:;.,~_"
def decompress(code):
lua = bytearray()
@eevee
eevee / famicube64-canon-order.pal
Last active May 6, 2017 08:00
Famicube 64 palette
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 / potluck.js
Created May 12, 2017 02:06
initial crack at potluck with pixi, because someone asked
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);
@eevee
eevee / gist:59012b2a3d4dcdb40b5247ecdc2cfb34
Created May 23, 2017 13:50
tileset potluck contributors
@__mote
@aBinaryTernary
@ach_crvens
@amymist
@BarryBenson2007
@bulbasort
@BushytailSkwirl
@doniamae
@eevee
@eltoraz
@eevee
eevee / gist:8e667314eb935d8faef999ead9fc7f3f
Created May 30, 2017 20:05
lowercase texture names in doom 2
brick1 - 1 uses, total area 1024 ≈ 0.25 tiles
brown1 - 1 uses, total area 4608 ≈ 1.125 tiles
brownhug - 4 uses, total area 10702.049 ≈ 2.612805 tiles
compblue - 2 uses, total area 2035.1354 ≈ 0.49685922 tiles
door1 - 2 uses, total area 9216 ≈ 2.25 tiles
door1 - 2 uses, total area 9216 ≈ 2.25 tiles
doorblu - 2 uses, total area 3072 ≈ 0.75 tiles
doorstop - 19 uses, total area 2176 ≈ 0.53125 tiles
doorstop - 2 uses, total area 0 ≈ 0 tiles
doorstop - 20 uses, total area 0 ≈ 0 tiles
@eevee
eevee / nations-of-the-world.md
Last active March 27, 2018 20:23
Nations of the World (2017 edition)

(with apologies to Yakko Warner)

Lyrics

United States, Canada, Mexico, Panama,
Haiti, Jamaica, Peru,
Republic Dominican isn't Dominica,
Cuba, El Salvador, too.

@eevee
eevee / beta.txt
Created January 3, 2018 02:37
generating a random angle by picking (x, y) from various distributions with 1M trials
random.betavariate(2, 2) * 2 - 1
0 | ###########################################################################
10 | ###############################################################################
20 | #####################################################################################
30 | #############################################################################################
40 | ###################################################################################################
50 | ##############################################################################################
60 | #####################################################################################
70 | ###############################################################################
80 | ############################################################################
@eevee
eevee / main.lua
Created January 21, 2018 05:28
non-working LÖVE app with a rotating quad that never draws
local checkerboard
local shader
function love.load()
love.graphics.setDefaultFilter('nearest', 'nearest')
local imagedata = love.image.newImageData(8, 8)
imagedata:mapPixel(function(x, y, r, g, b, a)
if (x + y) % 2 == 1 then
return 192, 192, 192, 255
@eevee
eevee / untitled.cpp
Last active March 31, 2018 20:55
zero initialization in c++
#include <iostream>
#include <string.h>
struct A {
int b;
};
int main() {
{
char blah[256];
@eevee
eevee / bitcrush.py
Created July 4, 2018 01:28
anise aowr bitcrusher
import wave
TARGET_RATE = 16384
with wave.open('aowr2.wav') as w:
with wave.open('aowrcrush2.wav', 'wb') as wout:
nchannels, sample_width, framerate, nframes, _, _ = w.getparams()
wout.setparams(w.getparams())
outdata = bytearray()
gbdata = bytearray()