Skip to content

Instantly share code, notes, and snippets.

View magical's full-sized avatar
🙀
🐛

Andrew Ekstedt magical

🙀
🐛
View GitHub Profile
<?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.
#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 August 3, 2019 04:22
hg/ss headbutt data dumper (circa 2012)
# 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 August 3, 2019 04:15
hg/ss safari data parser (circa 2010)
#!/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"
#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 )
@magical
magical / matrix-irc.md
Created March 1, 2019 00:24
HOWTO connect to IRC with matrix (draft)

HOWTO connect to IRC with matrix

This guide explains how to connect to freenode channels via matrix, using riot.im.

  1. matrix.org runs a public freenode bridge.

  2. channels follow the pattern #freenode_#channel:matrix.org, so if you wanted to join #python on freenode, you'd type '#freenode_#python:matrix.org' into the join channel box in riot.im.

@magical
magical / flim.lily
Last active September 13, 2018 20:02
\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'
@magical
magical / hangman.py
Last active April 25, 2018 06:32
LUG hangman, team 2
# Team 2
from __future__ import print_function
def prompt(question):
question = question.lstrip(' ') + ' '
answer = raw_input(question).strip()
while not answer:
answer = raw_input(question).strip()
return answer
@magical
magical / git-tips.txt
Created April 18, 2018 00:22
git tips & tricks
git tips & tricks
0. cloning
git clone ./repo ./clone # do a local clone
1. the index / patch mode
git add -p