Skip to content

Instantly share code, notes, and snippets.

View pushrbx's full-sized avatar

pushrbx pushrbx

View GitHub Profile
cmake_minimum_required(VERSION 2.8.11)
project(VtkFboInQtQuick)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
@pushrbx
pushrbx / springdotnet-contextmerge.cs
Last active August 29, 2015 14:22
Spring.NET - Merge two application contexts.
public static void MergeWith(this AbstractApplicationContext targetContext,
AbstractApplicationContext sourceContext)
{
Check.NotNull(sourceContext, "sourceContext");
targetContext.Stop();
foreach (var definitionName in sourceContext.GetObjectDefinitionNames())
{
var definition = sourceContext.GetObjectDefinition(definitionName);
targetContext.RegisterObjectDefinition(definitionName, definition);
@pushrbx
pushrbx / SerialPortWrapper.cs
Created September 8, 2015 13:36
C# Serial Port wrapper. Works great with arduinos.
using System;
using System.IO.Ports;
using System.Threading;
using System.Threading.Tasks;
namespace AwesomeSerialDeviceWrapper
{
public class SerialDevice : IDisposable
{
private long m_timeSinceLastEvent;
@pushrbx
pushrbx / SpringNetContextMerge.cs
Created September 8, 2015 13:39
Spring.NET - Merge two application contexts. Extension methods.
public static void MergeWith(this AbstractApplicationContext targetContext,
AbstractApplicationContext sourceContext)
{
Check.NotNull(sourceContext, "sourceContext");
targetContext.Stop();
foreach (var definitionName in sourceContext.GetObjectDefinitionNames())
{
var definition = sourceContext.GetObjectDefinition(definitionName);
targetContext.RegisterObjectDefinition(definitionName, definition);
@pushrbx
pushrbx / gist:520f4c962eaef07416ebfd9caa2cfc2b
Created April 16, 2016 09:34
Razer Synapse stopped working: When right clicking on its icon in taskbar the coming up context menu freezes.
/// this gist about an issue with the razer synapse: Usually after windows update it doesn't come up ever again when you double
/// click on its icon. Also all the macros and key bindings stop working.
/// The invisible exception's stack trace is the following:
2016-01-04 19:05:33,575 [SynpaseMain::26620] DEBUG Razer.Emily.UI.SynapseApp [(null)] - DeviceMgr::Start
2016-01-04 19:05:33,580 [SynpaseMain::26620] DEBUG Razer.Emily.UI.AppEntryPoint [(null)] - SynapseMain::Failed
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {7CC0C4B6-B68F-4141-9023-E3A189EDE86D} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipChe
@pushrbx
pushrbx / ws_soulworker.lua
Created October 19, 2018 20:55 — forked from x1nixmzeng/ws_soulworker.lua
Soul Worker Wireshark Dissector (packet analyser)
-- Soul Worker Wireshark Dissector rev 1
-- Written by WRS/x1nixmzeng (forum.xentax.com)
-- Usage: wireshark.exe -X lua_script:ws_soulworker.lua
local sw_port = 27017
sw_proto = Proto("sw_proto","Soul Worker Protocol")
local sw_method =
{
@pushrbx
pushrbx / soul_worker_res_types.txt
Created October 22, 2018 18:57 — forked from x1nixmzeng/soul_worker_res_types.txt
Quick python script to dump the structures from Soul Worker Online
012640BC PUSH SoulWork.01C79544 ASCII "tb_Achievement"
01264666 PUSH SoulWork.01C79558 ASCII "tb_Achievement_begin"
0126478C PUSH SoulWork.01C79570 ASCII "tb_Achievement_Emblem"
01264AAC PUSH SoulWork.01C79588 ASCII "tb_Achievement_Script"
01264C66 PUSH SoulWork.01C795A0 ASCII "tb_Akashic_Disassemble"
01264DA6 PUSH SoulWork.01C795B8 ASCII "tb_Akashic_Make"
01264F0C PUSH SoulWork.01C795C8 ASCII "tb_Akashic_Parts"
012651DC PUSH SoulWork.01C795DC ASCII "tb_Akashic_Records"
0126587C PUSH SoulWork.01C795F0 ASCII "tb_Appearance"
01265AF6 PUSH SoulWork.01C79600 ASCII "tb_Aura"
@pushrbx
pushrbx / qscript_read.py
Created October 22, 2018 21:17
Ugly python script which extracts the text from tb_Quest_Scripts_eng.res file of Soulworker into a json file.
import os
import json
import codecs
def read_block(f):
block_size = 0
index = int.from_bytes(bytes(f.read(4)), byteorder='little')
block_size += 4
len1 = int.from_bytes(bytes(f.read(2)), byteorder='little')
block_size += 2
[Serializable]
public enum VKeys
{
KEY_0 = 0x30, //0 key
KEY_1 = 0x31, //1 key
KEY_2 = 0x32, //2 key
KEY_3 = 0x33, //3 key
KEY_4 = 0x34, //4 key
KEY_5 = 0x35, //5 key
KEY_6 = 0x36, //6 key
@pushrbx
pushrbx / Microsoft.PowerShell_profile.ps1
Last active August 23, 2019 11:08
A function for your powershell profile which helps activating the python venv in PyCharm. (Assuming that you use the default folders offered by pycharm on project creation)
function IfTrue($a, $b, $c) { if ($a) { $b } else { $c } }
function Coalesce($a, $b) { if ($a -ne $null) { $a } else { $b } }
New-Alias "??" Coalesce
New-Alias "?:" IfTrue
function py-avenv {
param (