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 / perlin.py
Last active March 2, 2024 08:48
Perlin noise in Python
"""Perlin noise implementation."""
# Licensed under ISC
from itertools import product
import math
import random
def smoothstep(t):
"""Smooth curve with a zero derivative at 0 and 1, making it useful for
interpolating.
@eevee
eevee / spabs.md
Last active February 20, 2024 08:29
tabs to spaces
@eevee
eevee / gist:c57e72e7f39a09c6f7d1
Created June 15, 2014 04:39
fontconfig to make source code pro fall back to monospace, not sans-serif
<!-- define font family for some fonts fontconfig doesn't know about -->
<alias>
<family>Source Code Pro</family>
<default><family>monospace</family></default>
</alias>
<alias>
<family>Droid Sans Mono</family>
<default><family>monospace</family></default>
</alias>
<alias>
@eevee
eevee / hlscroll.pl
Created April 13, 2012 03:49
scroll to next/prev hilighted line in irssi
use strict;
use Irssi qw(command_bind MSGLEVEL_HILIGHT);
use vars qw($VERSION %IRSSI);
# Recommended key bindings: alt+pgup, alt+pgdown:
# /bind meta2-5;3~ /scrollback prev
# /bind meta2-6;3~ /scrollback next
$VERSION = '0.02';
%IRSSI = (
@eevee
eevee / gist:9cf655e617859d2765f7
Created September 4, 2014 00:40
outline shader for THREE.js
var outline_shader = {
uniforms: {
"linewidth": { type: "f", value: 0.3 },
},
vertex_shader: [
"uniform float linewidth;",
"void main() {",
"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",
"vec4 displacement = vec4( normalize( normalMatrix * normal ) * linewidth, 0.0 ) + mvPosition;",
"gl_Position = projectionMatrix * displacement;",
@eevee
eevee / fonts.conf.xml
Last active September 5, 2022 03:42
my fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<dir>~/.fonts</dir>
<alias>
<family>serif</family>
<prefer>
<family>Source Serif Pro</family>
<family>IPAMincho</family>
</prefer>
@eevee
eevee / wordle2.py
Created January 22, 2022 03:36
wordl brute-force (best run with pypy) (there is no CLI sorry)
# don't @ me
import collections
import random
import re
import string
LENGTH = 5
class Datum:
@eevee
eevee / Makefile
Created December 17, 2019 06:21
make choking on colon
title = Star\ Anise\ Chronicles:\ Escape\ from\ the\ Chamber\ of\ Despair
# Arch Linux
INFORM7_BIN = /usr/libexec/gnome-inform7
# Ubuntu x64
#INFORM7_BIN = /usr/lib/x86_64-linux-gnu/gnome-inform7
all: glulx
project = $(title).inform
@eevee
eevee / gist:dd1056918e4b8730386a676ef1e0361b
Created May 5, 2021 23:43
chip's challenge mscc (first) vs nes (second)
LESSON 1
Hints differ in case and/or spacing only
LESSON 2
Hints differ in case and/or spacing only
LESSON 3
Hints differ:
- Suction-boots for force floors. Fire boots for fire. Flippers for water. Skates for ice.
- MAGNET FOR␤FORCE FLOORS.␤HEAT SHIELD␤FOR FIRE.␤WATER SHIELD␤FOR WATER.␤CLEATS FOR ICE.