Skip to content

Instantly share code, notes, and snippets.

@superjohan
superjohan / filter.kt
Created February 24, 2019 15:56
Really simple somewhat functional filter for getting rid of duplicates in ROM sets
import java.io.File
fun main(args: Array<String>) {
val files = File("/path/to/roms/Game Boy").listFiles()
files.sortBy { it.name }
val gameNames = mutableListOf<String>()
for (file in files) {
val gameName = file.name.substringBefore(" (")
@superjohan
superjohan / saveframe.swift
Created March 6, 2018 19:06
little snippet for saving every frame in a scenekit render loop
if !self.shouldRender {
return
}
if self.imageCount == 4 * 60 {
self.showGroupLogo(showBoolean: NSNumber.init(value: true))
} else if self.imageCount == 6 * 60 {
self.showGroupLogo(showBoolean: NSNumber.init(value: false))
} else if self.imageCount == 10 * 60 {
self.setErrorState(errorStateBoolean: NSNumber.init(value: true))
@superjohan
superjohan / digest.py
Created February 3, 2018 09:38
create md5+sha1 digests for maven purposes
#!/usr/local/bin/python3
import click
import hashlib
import os
@click.command()
@click.argument('filename')
@superjohan
superjohan / testrunner.py
Created June 2, 2016 10:35
small looping test runner to help find flaky tests on Android
import subprocess
import shlex
import shutil
def run():
times_run = 1
failures = 0
while True:
### Keybase proof
I hereby claim:
* I am superjohan on github.
* I am jkh (https://keybase.io/jkh) on keybase.
* I have a public key whose fingerprint is 9EBE FA58 20AA F248 A5B1 E8F3 8A7B 57D3 F483 183D
To claim this, I am signing this object: