Skip to content

Instantly share code, notes, and snippets.

@lkolbly
lkolbly / parseBrf.py
Created January 3, 2017 17:29
Python parser for the Star Wars: X-Wing (Collector's CD) .BRF mission briefing file format.
import json
import struct
ANIMATION_COMMANDS = {
1: ('wait_for_click', []),
10: ('clear_text', []),
11: ('show_title', [('i', 'text_id')]),
12: ('show_main', [('i', 'text_id')]),
15: ('center_map', [('f', 'x'), ('f', 'y')]),
16: ('zoom_map', [('f', 'x'), ('f', 'y')]),
@mricon
mricon / dovecot-zlib-cron-compressor.sh
Last active November 7, 2021 19:44
Implements the cron script described on http://wiki2.dovecot.org/Plugins/Zlib for compressing old maildir messages. Use only after enabling the Dovecot zlib plugin.
#!/bin/bash
# This is implementation of the script that compresses old maildir messages
# as described in http://wiki2.dovecot.org/Plugins/Zlib
#
# Copyright (C) 2016 by Konstantin Ryabitsev
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
@kirkonrails
kirkonrails / log all jQuery events
Created April 9, 2014 13:20
Log all jQuery events to console via redfine jquery trigger
var oldJQueryEventTrigger = jQuery.event.trigger;
jQuery.event.trigger = function( event, data, elem, onlyHandlers ) {
console.log( event, data, elem, onlyHandlers );
oldJQueryEventTrigger( event, data, elem, onlyHandlers );
}