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 / commands.bash
Created February 21, 2022 15:02
Mac Setup
chflags nohidden ~/Library
defaults write com.apple.loginwindow LoginwindowLaunchesRelaunchApps -bool false
defaults write com.apple.finder AppleShowAllFiles true
defaults write com.apple.finder QLEnableTextSelection -bool true
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
defaults write com.apple.DiskUtility advanced-image-options -bool true
defaults write com.apple.helpviewer DevMode -bool true
sudo nvram SystemAudioVolume=%80
@xanathar
xanathar / DefaultKeyBinding.dict
Created April 14, 2021 08:06
My MacOS key bindings
{
"\UF729" = moveToBeginningOfParagraph:; // home
"\UF72B" = moveToEndOfParagraph:; // end
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
"#," = ("insertText:", "."); // keypad comma to dot
}
@xanathar
xanathar / D04.cs
Created March 22, 2021 13:04
Waking Violet, simple level
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using API;
namespace Assets.Code.Anubi.Levels
{
class D04 : LevelScript
{
@xanathar
xanathar / A01.cs
Created March 22, 2021 12:54
Waking Violet first level source code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using API;
using Assets.Code.Anubi.DefPresets;
using UnityEngine;
namespace Assets.Code.Anubi.Levels
{
@xanathar
xanathar / write_tga.h
Last active January 7, 2021 09:57
Write TGA file in C with zero dependencies (apart stdio)
/**
* writetga: A zero dependencies writer for the TGA file format.
*
* Copyright 2020 Marco Mastropaolo <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@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