Skip to content

Instantly share code, notes, and snippets.

View lifning's full-sized avatar
💜

liffy lifning

💜
View GitHub Profile
@lifning
lifning / glc-encode.sh
Created June 14, 2012 09:18
A quick and dirty script to convert glc dumps to MKV using ffmpeg. Created because mencoder, which the glc encode script uses, is broken and old.
#!/bin/bash
mkfifo ${1}.{yuv,wav}
glc-play ${1} -y 1 -o ${1}.yuv &
glc-play ${1} -a 1 -o ${1}.wav &
ffmpeg -i ${1}.yuv -i ${1}.wav ${1}.mkv
rm -f ${1}.{yuv,wav}
@lifning
lifning / pddl-domain.lisp
Created June 9, 2012 03:37
some ideas for data format and so on.
(define (domain n64-zelda-majora)
(:requirements :typing :fluents :durative-actions)
(:types
item cycevt location object
)
(:constants
bow ocarina powder-keg goron-mask eponas-song song-of-time - item
@lifning
lifning / jsdump.py
Last active December 17, 2021 01:43
A simple pygame-based script to dump joystick events. Useful if jstest isn't readily available.
#!/usr/bin/env python3
from pygame import display, joystick, event
from pygame import QUIT, JOYAXISMOTION, JOYBALLMOTION, JOYHATMOTION, JOYBUTTONUP, JOYBUTTONDOWN
h = {
(0,0): 'c',
(1,0): 'E', (1,1): 'NE', (0,1): 'N', (-1,1): 'NW',
(-1,0): 'W', (-1,-1): 'SW', (0,-1): 'S', (1,-1): 'SE'
}
@lifning
lifning / mmmulticamcamcam.sh
Created February 18, 2012 06:19
gstreamer-based camera simulator
#!/bin/bash
DEV=$(zenity --file-selection \
--filename=/dev/video0 \
--file-filter='V4L2 loopback devices | video*')
echo "Select a window to capture..."
XID=$(xwininfo -int | grep 'Window id' | awk '{print $4}')
# camera width/height
@lifning
lifning / libsnes-pygame.py
Created November 23, 2011 19:35
Quick and dirty libsnes-based emulator using pygame.
#!/usr/bin/env python2
import sys, getopt, ctypes, struct
import pygame, numpy
from snes import core as snes_core
# libsnes library to use by default.
@lifning
lifning / now-playing.py
Last active September 28, 2015 00:08
xchat lastfm now-playing
# -*- coding: utf-8 -*-
# a last.fm now playing script originally written by Brandon Sutton
# some modifications by lifning
__module_name__ = "last.fm"
__module_version__ = "1.0"
__module_description__ = "/np for last.fm"
try:
import hexchat as xchat
except ImportError: