Skip to content

Instantly share code, notes, and snippets.

View xanathar's full-sized avatar
🐢
I may be slow to respond. Who am I kidding?. I will be VERY slow to respond.

Marco Mastropaolo xanathar

🐢
I may be slow to respond. Who am I kidding?. I will be VERY slow to respond.
View GitHub Profile
@xanathar
xanathar / launch.json
Created September 17, 2020 18:16
launch.json to debug Rust with VsCode
{
// The following are sample configurations for common case scenarios of debugging
// Rust in Visual Studio Code
//
// For syntax, visit: https://go.microsoft.com/fwlink/?linkid=830387
//
"version": "0.2.0",
"configurations": [
{
"name": "Launch an application",
@xanathar
xanathar / rdparser.rs
Last active May 10, 2020 22:12
Draft of RD parser for simple expressions, written in Rust
use std::collections::VecDeque;
use crate::errors::{ Result, Error };
use crate::langvalue::LangValue;
// Grammar
//
// name := <string>
// condop: GreaterThan | LessThan | GreaterThanEqual | LessThanEqual | Equals | NotEquals | Contains
// notop := Not
@xanathar
xanathar / keybase.md
Created March 30, 2020 16:49
keybase.md

Keybase proof

I hereby claim:

  • I am xanathar on github.
  • I am xanathar (https://keybase.io/xanathar) on keybase.
  • I have a public key ASDfOxyAg1rjE0mIvUeDO3OVbP5bXw7q6Whv-1Lw2vS9ogo

To claim this, I am signing this object:

@xanathar
xanathar / webcamrdium_leviosa.sh
Created March 22, 2020 12:38
Workaround for flipped Asus webcams on Ubuntu
#! /bin/bash
sudo modprobe v4l2loopback exclusive_caps=1
ffmpeg -f v4l2 -input_format mjpeg -pix_fmt=yuyv422 -i /dev/video0 -vf "vflip" -f v4l2 /dev/video1
@xanathar
xanathar / poe2_crash.log
Created September 16, 2018 14:17
PoE Crash Stacktrace
NullReferenceException: Object reference not set to an instance of an object
at OEIFormats.ClassExtender.GetExtendedPropertyValue (System.String propertyName) [0x00000] in <filename unknown>:0
at Game.FlowChartPlayer..ctor (Game.FlowChart flowChart, Int32 startNodeID, UnityEngine.GameObject ownerObject) [0x00000] in <filename unknown>:0
at Game.ConversationManager.StartConversation (Game.Conversation conversation, Int32 startNode, UnityEngine.GameObject owner, Boolean disableVO) [0x00000] in <filename unknown>:0
at Game.ConversationManager.StartConversation (Guid conversationID, Int32 startNode, UnityEngine.GameObject owner, Boolean disableVo) [0x00000] in <filename unknown>:0
at Game.ConversationManager.StartConversation (Guid conversationID, Int32 startNode, UnityEngine.GameObject owner) [0x00000] in <filename unknown>:0
at Game.FlowChart.MoveToNode (Int32 nodeID, Game.FlowChartPlayer player) [0x00000] in <filename unknown>:0
at Game.Conversation.StartFlowChart (Game.FlowChartPlayer play
@xanathar
xanathar / DefaultKeyBinding.dict
Created May 22, 2018 14:22
DefaultKeyBinding.dict
{
"\UF729" = moveToBeginningOfLine:; // home
"\UF72B" = moveToEndOfLine:; // end
"$\UF729" = moveToBeginningOfLineAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfLineAndModifySelection:; // shift-end
"#," = ("insertText:", "."); // dot keypad
}
@xanathar
xanathar / winmerge.sh
Created November 9, 2017 12:15
Run WinMerge from Unix shell after installing Wine
#! /bin/bash
if [ $# -eq 0 ]; then
FILE1=$(winepath -w . 2>/dev/null)
wine "C:\program files (x86)\WinMerge\WinMergeU.exe" "$FILE1"
elif [ $# -eq 1 ]; then
FILE1=$(winepath -w "$1" 2>/dev/null)
wine "C:\program files (x86)\WinMerge\WinMergeU.exe" "$FILE1"
else
FILE1=$(winepath -w "$1" 2>/dev/null)
@xanathar
xanathar / LoggerHandler.cs
Last active August 10, 2016 13:35
ASP.NET MVC / WebApi Logger handler
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http.ExceptionHandling;
using Castle.Core.Logging;
@xanathar
xanathar / main.cpp
Created June 15, 2016 09:30
Simple example of Lua integration in C++
//
// main.cpp
// LuaTests
//
// Created by Marco Mastropaolo on 08/06/16.
// Copyright © 2016 Marco Mastropaolo. All rights reserved.
//
#include <iostream>
#include "../include/lua.hpp"
@xanathar
xanathar / ProtectedGlobals.cs
Last active September 1, 2018 13:48
Protect globals in C# using MoonSharp
using MoonSharp.Interpreter;
using System;
namespace Test
{
class Program
{
private static void CaptureNewIndex(Table table, DynValue index, DynValue value)
{
if (index.String == "math")