Skip to content

Instantly share code, notes, and snippets.

@seece
seece / find_todos.sh
Created February 26, 2014 16:22
Find all FIXMEs and TODOs from .cpp source files in current dir.
find . -name "*.cpp" | xargs awk '/(FIXME|TODO)/ { print FILENAME ":" NR "\t" $0 }'
@seece
seece / vxl_palette_extract.py
Created June 22, 2014 15:07
VXL palette extractor
#!/usr/bin/env python
import argparse
from struct import *
"""
http://xhp.xwis.net/documents/VXL_Format.txt
The header is fixed length, 802 bytes, and contains a few fixed size records and a colour palette.
struct vxl_header
@seece
seece / _vimrc
Created August 24, 2014 12:40
gvim settings
set langmenu=en_US.UTF-8 " sets the language of the menu (gvim)
set sw=4
set ts=4
colorscheme slate
noremap ; :
if has('gui_running')
set guifont=Lucida_Console:h10
@seece
seece / parts.c
Created February 17, 2015 21:15
Splits binary files in two parts.
#include <stdio.h>
#include <stdlib.h>
#define FTELL _ftelli64
#define FSEEK _fseeki64
void usage()
{
puts("parts FILE OUTPUT OFFSET [LENGTH]");
}
@seece
seece / compare.py
Created March 9, 2015 20:36
File byte distribution comparison
"""
compares the byte value distribution of the first argument with all the files in victims/
"""
from distr import calc_distribution
import os
import pickle
import sys
def dot(d1, d2):
@seece
seece / do.bat
Created October 27, 2015 19:55
ffmpeg and imagemagick - split video to frames and back
rem see https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/image_sequence
ffmpeg -i "video.mp4" -vf -fps=14.985015 captures\out%04d.png
REM scale the frames and quantize to 24 color palette
for %%f in (%1\*.png) do ( E:\tools\imagemagick\convert.exe "%%f" -resize x144 -unsharp 0x1 -crop 160x144+48+0 -dither None -colors 24 -scale 300%% "%2\%%~nf.png" )
ffmpeg -framerate 14.985015 -i scaled\out%04d.png -crf 18 video.mp4
@seece
seece / build.bat
Created December 7, 2015 19:57
Build MSVC2015 project
@echo off
REM Setup vcvars if they are not defined
if not defined DevEnvDir (
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
)
call msbuild.exe /VERBOSITY:quiet /property:Configuration=Release solution.sln
echo done %date% %time%
@seece
seece / nes_controller.pde
Created January 13, 2016 13:42
How to read NES controller button presses with an Arduino
/* This code is released into the public domain.
* Pekka Väänänen, 2016 */
/*
http://www.mit.edu/~tarvizo/nes-controller.html
+----> Power +5V (white)
|
5 +---------+ 7
| x x o \
@seece
seece / ttrack.py
Created May 10, 2016 20:42
A "timetracker" "application"
import readline
import datetime
logpath = "times.txt"
lines = []
try:
with open(logpath, "r") as f:
lines = f.readlines()
except:
@seece
seece / LAAMATUT.TXT
Created May 26, 2016 18:40
Laaman tie DJGPP-peliohjelmointiin versio 2.10. By Jokke / BAD KARMA
▄▄▄▄▄ ▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄
█▓▒░ ░█ █▓▒░ ░▒▓▒█ █▒░ ░▒▓▒░ █ █░ ░▒▓▒░█ █▓▒░ ░▒▓█ █ ░▒▓▒░ ░▒█
█▒░ ░▒█ █▒░ ░▒▓▒░█ █░ ░▒▓▒░ ░█ █ ░▒▓▒░ █ █▒░ ░▒▓▒█ █░▒▓▒░ ░▒▓█
█░ ░▒▓█ █▒░ ░▒▓▒░ ░█ █░ ░▒▓▒░ ░▒▓█ █░▒▓▒░ ░▒█▒░ ░▒▓▒░█ █▒▓▒░ ░▒▓▒█
█ ░▒▓▒█ █░ ░▒▓▒░ ░▒█ █ ░▒▓▒░ ░▒▓▒█ █▒▓▒░ ░▒▓▒░ ░▒▓▒░ █ █▒▓▒░ ░▒▓▒░ █
█░▒▓▒░█ █ ░▒▓██ ░▒▓█ █░▒▓▒░██▒▓▒░█ █▓▒░ ░▒▓▒░ ░▒▓▒░ ░█ █▓▒░ ░██▒░ ░█
█▒▓▒░ █ █░▒▓▒██░▒▓▒█ █▒▓▒░ ██▓▒░ ░██▒░ ░▒█▒░ ░▒█▒░ ░▒█ █▒░ ░▒██░ ░▒█
█▓▒░ ░█ █░▒▓▒░██▒▓▒░ █▒▓▒░ ░██▒░ ░▒██░ ░▒▓█░ ░▒▓█░ ░▒▓█ █░ ░▒▓██ ░▒▓█
█▒░ ░▒█▄▄▄█▒▓▒░ ░▒▓▒░ ░█▓▒░ ░▒▓▒░ ░▒▓██ ░▒▓▒█ ░▒▓▒█ ░▒▓▒██░ ░▒▓▒░ ░▒▓▒░█
█░ ░▒▓▒░ ░▒▓▒░ ░▒▓▒░ ░▒▓▒░ ░▒▓▒░ ░▒▓▒░ ░▒▓▒░██▒▓▒██░▒▓▒░██ ░▒▓▒░ ░▒▓▒░ █