Skip to content

Instantly share code, notes, and snippets.

View Miss-Inputs's full-sized avatar
🐈
Being a cat

Megan Leet Miss-Inputs

🐈
Being a cat
View GitHub Profile
@Miss-Inputs
Miss-Inputs / bogosort.cbl
Created August 27, 2017 03:58
Bogosort in COBOL that I guess I made for an assignment (warning: disgusting)
000000 IDENTIFICATION DIVISION.
000000 PROGRAM-ID. AdvCobolAss2.
000000 DATA DIVISION.
000000 WORKING-STORAGE SECTION.
000000 01 TABLE-COUNT PIC 99.
000000 01 THE-TABLE.
000000 05 TABLE-ITEM
000000 OCCURS 1 TO 99 TIMES DEPENDING ON TABLE-COUNT PIC X(99).
000000 01 THE-TABLE-LENGTH.
000000*Apparently I have to put this in a seperate 01 clause, thus
@Miss-Inputs
Miss-Inputs / helloworld.ps1
Last active December 6, 2017 07:42
Stupid hello world
function translate([string][Parameter(valueFromPipeline=$true)]$text, $sourceLanguage, $targetLanguage){
if($sourceLanguage -eq $targetLanguage){
return $text
}
$url = "https://translate.googleapis.com/translate_a/single?client=gtx&sl=$([Uri]::escapeDataString($sourceLanguage))&tl=$([Uri]::escapeDataString($targetLanguage))&dt=t&q=$([Uri]::escapeDataString($text))"
$response = irm $url
return $response[0][0][0]
}
@Miss-Inputs
Miss-Inputs / blah.ps1
Last active August 29, 2017 19:04
The ROM Recognizer
#I have a folder full of folders of ROMs and a folder full of No-Intro DATS. Time to stay up all night
#Doesn't work with zips
function md5($path){
$md5 = [Security.Cryptography.MD5]::create("MD5")
$file = [IO.File]::openRead($path)
$buf = new-object byte[] (1024*8)
while (($read_len = $file.read($buf,0,$buf.length)) -eq $buf.length){
[void]$md5.transformBlock($buf, $offset, $buf.length, $buf, $offset)
@Miss-Inputs
Miss-Inputs / Parse Progman groups.ps1
Created September 21, 2017 11:40
Parse Progman groups
$progman_ini = 'Y:\Dosbox\WINDOWS\PROGMAN.INI'
$ascii = [Text.Encoding]::ASCII
#TIconHeader:
#Hot spot X: Integer (Should be 0)
#Hot spot Y: Integer (Should be 0)
#Width: Integer
#Height: Integer
#Bytes per row accounting for word alignment (what?): Integer
#Number of planes: Byte
@Miss-Inputs
Miss-Inputs / AssemblyHax.cls
Last active September 18, 2021 13:54
Run assembly code in Visual Basic (for Applications I guess)
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "AssemblyHax"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
@Miss-Inputs
Miss-Inputs / ByteStringBuilder.cls
Created October 1, 2017 23:57
String builder class for VB/VBA
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "ByteStringBuilder"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
@Miss-Inputs
Miss-Inputs / blah.ps1
Last active February 2, 2018 17:37
7z every file in a directory matching an extension individually at max power
ls *.ext | % {& $7z a -mx9 ([IO.Path]::GetFileNameWithoutExtension($_) + ".7z") $_.fullName}
@Miss-Inputs
Miss-Inputs / blah.sh
Last active February 4, 2018 12:52
Show duplicate files (barring MD5 collisions)
find . -type f -print0 | xargs -0 md5sum | sort | uniq -D -w32
@Miss-Inputs
Miss-Inputs / List gen 1 save file.py
Created February 8, 2018 04:37
Quick and dirty and unfinished lister for Pokemon gen 1 .sav files
#!/usr/bin/python3
import sys
import math
TEXT_TABLE = {}
TERMINATOR_CHAR = 0x50
TEXT_TABLE[TERMINATOR_CHAR] = '<terminator>'
#4B and 4C are unknown control chars
TEXT_TABLE[0x00] = '<null>'
@Miss-Inputs
Miss-Inputs / List gen 2 save file.py
Created February 8, 2018 10:59
Not-so-quick but definitely dirty and also unfinished Pokemon gen 2 save file parser
#!/usr/bin/env python3
import sys
TERMINATOR_CHAR = 0x50
TEXT_TABLE = {
TERMINATOR_CHAR: '<terminator>',
#TODO: The characters before this
0x7F: ' ',
0x80: 'A',