Skip to content

Instantly share code, notes, and snippets.

View BenjaminUrquhart's full-sized avatar
💭
I'm always busy :)

Benjamin Urquhart BenjaminUrquhart

💭
I'm always busy :)
View GitHub Profile
@BenjaminUrquhart
BenjaminUrquhart / STDIOPlus.java
Last active January 10, 2019 14:46
Adds date/time to standard output/error in Java
package net.benjaminurquhart.stdout;
import java.io.PrintStream;
import java.time.OffsetDateTime;
import java.util.Locale;
// yes yes I know there's no input for I here.
public class STDIOPlus extends PrintStream{
private static boolean enabled;
// Do NOT mess around with the stdout or stderr variables unless you want to risk breaking disable()
@BenjaminUrquhart
BenjaminUrquhart / Extractor.java
Last active January 3, 2019 19:13
Extracts the ogg files from the vvvvvvmusic.vvv file. Basically a Java clone of https://gist.github.com/lukegb/1169265
import java.io.File;
import java.io.FileInputStream;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Extractor {
public static int find(byte[] bytes, byte[] toFind, int start) {
import os
import sys
import traceback
mediaDir = "/media/"
def strip(string):
toRemove = ["'","/"," "]
stripped = ""
for i in string:
if i in toRemove:
stripped = stripped + "\ ".replace(" ","")