Skip to content

Instantly share code, notes, and snippets.

@mightyCelu
mightyCelu / mergeDbs.py
Last active May 24, 2018
Script for merging OmNET++ SQLite result files
View mergeDbs.py
#!/usr/bin/python3
import logging
import os
import os.path as osp
import sys
import sqlite3
schema = '''
@mightyCelu
mightyCelu / configure_file.py
Last active Apr 4, 2018
Helper to replace parts of a file with corresponding values
View configure_file.py
import os
from string import Template
def configure_file(template_filename, out, **kwargs):
"""Rewrites placeholders within the file according to the given argument
The file specified by template_filename is read. Occurences of template values (e.g. identifiers prefixed with '$',
for more details see string.Template) are replaced with the corresponding keyword argument value. The resulting file
is written to out. If out is a directory, the template's filename is stripped of the '.in' extension and used as
@mightyCelu
mightyCelu / timeout_state.py
Last active Jan 13, 2020
ROS smach state for waiting for a message up to some amount of time
View timeout_state.py
import roslib; roslib.load_manifest('smach_ros')
import rospy
import threading
import smach
__all__ = ['TimeoutState']
@mightyCelu
mightyCelu / wifi.tex.m4
Created Feb 1, 2018
WLAN QR Code page generator
View wifi.tex.m4
\documentclass[paper=a6]{scrartcl}
\usepackage[margin=.5cm]{geometry}
\usepackage{pst-barcode}
\usepackage{auto-pst-pdf}
\title{WLAN Access}
\date{}
\begin{document}
@mightyCelu
mightyCelu / backup.sh
Created Sep 5, 2013
Backup script using rsync and ssh
View backup.sh
#!/bin/sh
if [ $# != 2 ]
then
echo usage: $0 SOURCE HOST
exit 1
fi
SOURCE=$1
BACKUP_DIR=backup
@mightyCelu
mightyCelu / SpellPatch
Created Mar 28, 2013
Fix for Lightwell bug in MaNGOS
View SpellPatch
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 3ceb20b..c18d5cb 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -3143,8 +3143,8 @@ void Spell::_handle_immediate_phase()
if (m_spellInfo->Effect[j] == 0)
continue;
- // apply Send Event effect to ground in case empty target lists
- if (m_spellInfo->Effect[j] == SPELL_EFFECT_SEND_EVENT && !HaveTargetsForEffect(SpellEffectIndex(j)))