Skip to content

Instantly share code, notes, and snippets.

@andwn
andwn / kswrap.py
Created April 19, 2019 01:53
krkr crap
# Adds spaces into all .ks files (Kirikiri scenario) in the current directory to make them word wrap
# It throws the output in an out/ folder but doesn't create/replace it so uhh... do that yourself first
# I converted the game's font to some Adobe format with an online converter,
# then took the lines for standard ascii characters and tossed those in metrics.txt
import os, re
WX = []
def convert(inf, outf):
@andwn
andwn / flax.c
Created October 20, 2017 16:44
Decompress Glover PC FLA format (textures)
// Compile
// gcc flax.c -o flax
// Usage
// ./flax <input file>
// Outputs decompressed data to <input file>.out
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@andwn
andwn / a.c
Created September 25, 2016 07:07
a
#include <stdio.h>
int e(char*v){int c=0,p=0;
char d[4096];while(v[c]){switch
(v[c]){case '>':p++;break;
case'<':p
--;break;
case'+':d[p]++;break;
case'-':d[p]--;break;case'.':
putchar(d[p]);break;case',':d[p
]=getchar();break;case'[':if(!d[
@andwn
andwn / random.c
Created March 17, 2016 00:13
Tried to come up with an algorithm to randomly generate a Sonic level layout and got bored
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#define LAYOUT_WIDTH 40
#define LAYOUT_HEIGHT 10
typedef unsigned char byte;
typedef unsigned short word;
@andwn
andwn / palloc.c
Last active March 17, 2016 00:07
Better(tm) calloc to be used by mature adults who mean busines
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
void *memset(void*,int,size_t);
void *memcpy(void *to, const void *from, size_t size);
static void * (*myfn_calloc)(size_t nmemb, size_t size);
@andwn
andwn / deckview.c
Created March 16, 2016 23:59
Old card counter thing for hearthstone I made then a week later someone made a way better one
/*
* TODO Now:
* Add Saving/loading - DONE!
* Always on top option (maybe button) - DONE!
* Load/Save window - DONE!
* Load from command line argument (and drag deck file onto exe) - DONE!
* Get it to compile on windows again with the GTK stuff - DONE!
*
* TODO V2:
* Preset cards instead of manual typing (Card DB)
@andwn
andwn / circles.py
Created March 16, 2016 23:51
Tiny game where you are a circle and don't touch other circles
import pygame, sys, random
class circle():
def __init__(self):
self.x = 20 + random() * 600
self.y = 500
self.xsp = 0
self.ysp = -2 + random()
self.color = Color(
random.randint(0, 255), random.randint(0, 255),
@andwn
andwn / everyipv6.py
Created March 16, 2016 23:47
IPv6 version of everyip.py
from os import SEEK_CUR
f = open("everyip6.txt", "w")
b = [0,0,0,0,0,0,0,0]
for b[0] in range(0,0xFFFF):
for b[1] in range(0,0xFFFF):
for b[2] in range(0,0xFFFF):
for b[3] in range(0,0xFFFF):
for b[4] in range(0,0xFFFF):
for b[5] in range(0,0xFFFF):
for b[6] in range(0,0xFFFF):
@andwn
andwn / everyip.py
Created March 16, 2016 23:45
Every IP address, a must have for pro hackers
f = open("everyip.txt", "w")
for b1 in range(0,255):
for b2 in range(0,255):
for b3 in range(0,255):
for b4 in range(0,255):
f.write("{0}.{1}.{2}.{3}\n".format(b1,b2,b3,b4))
f.close()
# Hides values as invisible spaces in strings
# Usage: ht.py e string to encode
# or: ht.py d string to decode (remove formatting)
from random import randint
import sys, re
inv_str = [ u"\uFEFF", u"\uFE00" ]
#inv_str = [ "{TEST}", "{HI}", "{BYE}" ]