Skip to content

Instantly share code, notes, and snippets.

@mjtorn
mjtorn / dvdwhine.py
Last active May 14, 2020 12:56
Python script to rip your DVDs
#!/usr/bin/env python3
"""
Mapfile format:
## More than meets the eye
@ -a2 -q19
1 1x09 - Fire on the Mountain
@mjtorn
mjtorn / dvdwhine.sh
Last active May 11, 2020 11:20
Simple script to rip your DVDs
#!/usr/bin/env bash
# vim: ts=4 sw=4 sts=4 et ai
set -eu
### Usage: mapfile arguments
###
### Mapfile format:
### 1 1x09 - Fire on the Mountain
@mjtorn
mjtorn / escoria.vim
Created September 18, 2018 10:13
Vim syntax file for Escoria scripts
" Vim syntax file
" Language: Escoria Script
" Maintainer: Markus Törnqvist
" Last Change: 2018 09 18
" Inspired heavily by python's syntax stuff
setlocal foldmethod=syntax
"" Magic words
@mjtorn
mjtorn / export.py
Created May 29, 2018 06:17
To export builds/releases of an Escoria game
#!/usr/bin/env python3
"""
Assumes you have three templates: "Linux/X11", "Mac OSX" and "Windows Desktop"
all propertly configured with export templates and settings.
Version information should be %VERSION% throughout.
This script will replace that and some project settings for the build and then
reset them back.
@mjtorn
mjtorn / deal_dialog.py
Last active May 12, 2018 06:05
If you need to parse Escoria scripts for dialog but aren't far enough in your game to have all the scripts loaded for lockit.gd
#!/usr/bin/python3
from collections import namedtuple
import itertools
import operator
import re
import sys
DialogSpec = namedtuple('DialogSpec', ('fname', 'id', 'dialog', 'comment'))
@mjtorn
mjtorn / build-sfdroid-repos.sh
Last active January 19, 2017 07:02
Build sfdroid for the Fairphone2
#!/usr/bin/env bash
# vim: ts=4 sw=4 et ai
# Markus Törnqvist <[email protected]> 2016
# Licensed under the DWTFYW public license
set -eu
FP2_BLOBS=fp2-sibon-16.11.0-blobs.sh
@mjtorn
mjtorn / get-gits-fp2-sfdroid.py
Created July 1, 2016 10:53
Update Freephone2's Fairphone Open git repositories to build sfdroid
#!/usr/bin/env python3
from collections import namedtuple
import concurrent.futures
import os
import subprocess
import sys
@mjtorn
mjtorn / copykill.py
Created May 5, 2016 16:51
copykill 10-Sep-2003 17:12 7275
#!/usr/bin/python
import os, sys, string, getopt, filecmp
from path import path
from types import *
from stat import *
optlist = []
"""Global default parameters"""
@mjtorn
mjtorn / nvim.bash
Created January 5, 2016 03:44
How to execute local nvim
#!/usr/bin/env bash
set -eu
VIM_BASE=/home/mjt/.local/neovim-linux64/
export VIMRUNTIME=${VIM_BASE}/share/nvim/runtime/
exec ${VIM_BASE}/bin/nvim $@
@mjtorn
mjtorn / libhidapicap.c
Created January 2, 2016 12:37
Capture Razer Orbweaver HID traffic
/*
* License: WTFPL
* Markus Törnqvist <[email protected]>
*
* Influenced heavily by http://www.linuxquestions.org/questions/programming-9/read-from-a-usb-barcode-scanner-that-simulates-a-keyboard-495358/
* and the hidapi README example
*/
#include <errno.h>
#include <stdio.h>