Skip to content

Instantly share code, notes, and snippets.

View defensem3ch's full-sized avatar

DEFENSE MECHANISM defensem3ch

View GitHub Profile
@defensem3ch
defensem3ch / bgb-tv.sh
Created January 4, 2021 15:38
BGB-TV Bash FFmpeg script to generate CRT-stylized output from raw AVI and WAV files from BGB
#!/bin/bash
# A collection of FFmpeg filterchains which can be used to create a stylised
# 'CRT screen' effect on given input, specialized for raw AVI and WAV output
# from BGB Gameboy emulator.
#
# Includes basic demonstration FFmpeg command which takes "$1" input
# of video and audio files without extensions
#
# Requires:
@defensem3ch
defensem3ch / concat.py
Last active January 28, 2022 02:42
Concatenate wav files into one evenly-spaced wav file (128-file limit)
# Concatenate wav files into one evenly spaced wav file
# Requires sox and PySox https://github.com/rabitt/pysox
# License: Public domain
import sox, os
def combine_files(folder, files, out_filename, sample_rate, channels, bit_depth):
combine = sox.Combiner()
combine.convert(sample_rate, channels, bit_depth)
out_files = [f"{folder}/{file}" for file in files]
@defensem3ch
defensem3ch / botb_userscript.js
Last active July 13, 2024 14:59
BotB userscript
// ==UserScript==
// @name botb custom + donload grabber
// @author DEFENSE MECHANISM
// @version 0.4
// @namespace http://battleofthebits.com/
// @description Alternate layout and css for battleofthebits
// @updateURL https://github.com/defensem3ch/userscripts/raw/main/botb%20custom.user.js
// @downloadURL https://github.com/defensem3ch/userscripts/raw/main/botb%20custom.user.js
// @homepage https://defensemech.com
// @match https://battleofthebits.com/*
@defensem3ch
defensem3ch / munch_py3.py
Last active July 1, 2024 16:35
munch.py (py3)
#!/usr/bin/env python3 --
# -*- coding: utf-8 -*-
#
# munch.py - The only .it packer you'll need (eventually)
# by Ben "GreaseMonkey" Russell, 2011 - PUBLIC DOMAIN
# updates to python3 provided by .exe - thank you!!!
#
# ok the hype about IT214 compression was getting out of hand.
# it finally decompresses AND compresses samples correctly.
# i believe all IT214-related bugs have been ironed out with a chainsaw.