Skip to content

Instantly share code, notes, and snippets.

Avatar
🙀
🐛

Andrew Ekstedt magical

🙀
🐛
View GitHub Profile
View extractgarc.go
// Usage: extractgarc garcfile outdir
// Extract and decompress all files in garcfile to outdir.
package main
import (
"fmt"
"io"
"log"
"os"
"path/filepath"
View parse.hs
import Control.Monad (fail)
import Control.Monad.Trans (lift, liftIO)
import Text.Parsec ((<|>), (<?>))
import Text.Read (readMaybe)
import System.IO (hFlush, stdout)
import qualified Control.Monad.Trans.State.Strict as State
import qualified Data.HashMap.Strict as HashMap
import qualified Text.Parsec as P
View Grafikkomprimierung_PKMN_RGBY.xml
<?xml version="1.0" encoding="UTF-8" ?>
<mediawiki version="0.1" xml:lang="de">
<page>
<title>Grafikkomprimierung PKMN RGBY</title>
<revision>
<timestamp>2006-05-21T08:40:04Z</timestamp>
<contributor><username>Tauwasser</username></contributor>
<minor/>
<comment>/* Genereller Vorgang */</comment>
<text>Die Grafikkompression in Pokémon Rot, Grün, Blau und Gelb ist eine Kombination aus unkomprimierten Daten und einem RLE-Befehl, der nur 0-Bits schreibt.
View Search.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <pthread.h>
#include <time.h>
// Tiles
#define FLOOR 0x00
#define WALL 0x01
@magical
magical / headbutt.py
Created Aug 3, 2019
hg/ss headbutt data dumper (circa 2012)
View headbutt.py
# coding: utf-8
from struct import pack, unpack
from narc import parse_narc
from cStringIO import StringIO
from warnings import warn
"""
@magical
magical / safari.py
Created Aug 3, 2019
hg/ss safari data parser (circa 2010)
View safari.py
#!/usr/bin/env python3
import sys
from struct import pack, unpack
pokename = {
1: "Bulbasaur", 2: "Ivysaur", 3: "Venusaur", 4: "Charmander", 5: "Charmeleon", 6: "Charizard", 7: "Squirtle", 8: "Wartortle", 9: "Blastoise", 10: "Caterpie", 11: "Metapod", 12: "Butterfree", 13: "Weedle", 14: "Kakuna", 15: "Beedrill", 16: "Pidgey", 17: "Pidgeotto", 18: "Pidgeot", 19: "Rattata", 20: "Raticate", 21: "Spearow", 22: "Fearow", 23: "Ekans", 24: "Arbok", 25: "Pikachu", 26: "Raichu", 27: "Sandshrew", 28: "Sandslash", 29: "Nidoran(f)", 30: "Nidorina", 31: "Nidoqueen", 32: "Nidoran(m)", 33: "Nidorino", 34: "Nidoking", 35: "Clefairy", 36: "Clefable", 37: "Vulpix", 38: "Ninetales", 39: "Jigglypuff", 40: "Wigglytuff", 41: "Zubat", 42: "Golbat", 43: "Oddish", 44: "Gloom", 45: "Vileplume", 46: "Paras", 47: "Parasect", 48: "Venonat", 49: "Venomoth", 50: "Diglett", 51: "Dugtrio", 52: "Meowth", 53: "Persian", 54: "Psyduck", 55: "Golduck", 56: "Mankey", 57: "Primeape", 58: "Growlithe", 59: "Arcanine", 60: "Poliwag", 61: "Poliwhirl"
View simd.p4.cpp
#include "simd.p4.h"
// July 13, 2017: mjb -- changed rbx register to r8
// The convention is that rbx needs to be saved by the callee (i.e., pushed and popped),
// but rcx, rdx, r8, and r9 do not
// This fixed the bug that showed up in cs 475/575 project #5 in SQ 2017
void
SimdMul( float *a, float *b, float *c, int len )
View gist:e4a0bcc8c458e4799ab66c95f9592cee
Utilities
---------
htop
tree
atool
the_silver_searcher (silversearcher-ag)
whois
mtr
mosh
vim
View flim.lily
\header {
title = "Flim"
composer = "Aphex Twin"
arranger = "The Bad Plus"
}
melody = \relative c'' {
d4 f a ais
d, f a ais
c, ees g d'