Skip to content

Instantly share code, notes, and snippets.

@haliphax
haliphax / settings.json
Created May 2, 2022 15:06
Vim mode-dependent relative line numbers for VS Code
// plugins used:
// - https://marketplace.visualstudio.com/items?itemName=vscodevim.vim
// - https://marketplace.visualstudio.com/items?itemName=hoovercj.vscode-settings-cycler
{
"editor.lineNumbers":"relative",
"settings.cycle":[
{
"id":"lineNumber",
"overrideWorkspaceSettings":false,
@haliphax
haliphax / LongestContiguousClickstream.cs
Created April 21, 2022 16:37
Find longest common contiguous click stream between two user records
var user0 = new string[] { "/a", "/b", "/c", "/d", "/e", "/f" };
var user1 = new string[] { "/b", "/c", "/e", "/f" };
var user2 = new string[] { "/a", "/b", "/d", "/e", "/f" };
var user3 = new string[] { "/a", "/c", "/d", "/e", "/f" };
var user4 = new string[] { "/a", "/b", "/c", "/d", "/e", "/f" };
var user5 = new string[] { "/a", "/b", "/e", "/f" };
var user6 = new string[] { "/a", "/b", "/c", "/e", "/f" };
var user7 = new string[] { "/c", "/d", "/e", "/f" };
var user8 = new string[] { "/d", "/e", "/f" };
var user9 = new string[] { "/b", "/c", "/e", "/f" };
@haliphax
haliphax / docfx.Dockerfile
Last active April 14, 2022 17:48
Containerized docfx
FROM mono:6.8
ARG DOCFX_VERSION=2.59.2
ARG APT_PROXY
RUN /bin/bash -c " \
if [ -n \"${APT_PROXY}\" ]; then \
echo 'Acquire::http { Proxy \"${APT_PROXY}\"; };' \
>> /etc/apt/apt.conf.d/01proxy; \
fi" && \
apt-get update && \
apt-get install -y \
@haliphax
haliphax / build-aseprite.sh
Created April 9, 2022 18:05
Build Aseprite from source on Ubuntu 20.04
#!/bin/bash
# dependencies
[ -d "$HOME/aseprite" ] && rm -rf "$HOME/aseprite"
[ -d "$HOME/deps" ] && rm -rf "$HOME/deps"
mkdir "$HOME/deps" && \
export PATH="${PATH}:${HOME}/deps" && \
sudo apt install -y g++ wget git unzip cmake ninja-build libx11-dev libxcursor-dev libxi-dev libgl1-mesa-dev libfontconfig1-dev python2
[ $? -ne 0 ] && exit $?
@haliphax
haliphax / gw_pretty.ini
Last active April 6, 2022 17:37
Guild Wars Classic Reshade preset
PreprocessorDefinitions=
Techniques=UIDetect@UIDetect.fx,ContrastAdaptiveSharpen@CAS.fx,UIDetect_Before@UIDetect.fx,Monocular_Cues@Depth_Cues.fx,Blooming_HDR@BloomingHDR.fx,UIDetect_After@UIDetect.fx
TechniqueSorting=UIDetect@UIDetect.fx,ContrastAdaptiveSharpen@CAS.fx,UIDetect_Before@UIDetect.fx,Monocular_Cues@Depth_Cues.fx,Blooming_HDR@BloomingHDR.fx,UIDetect_After@UIDetect.fx
[BloomingHDR.fx]
Adapt_Adjust=0.500000
Adapt_Seek=0.500000
Auto_Bloom=0
Auto_Exposure=1
BloomCurve=2.000000
@haliphax
haliphax / utf8ify.py
Created June 1, 2021 18:01
Convert ASCII artwork to UTF-8 for display in modern terminal emulators
"UTF-8ify textmode ASCII artwork for display in modern terminal emulators."
# codec borrowed from https://github.com/jquast/x84
# stdlib
import codecs
import re
from sys import argv
@haliphax
haliphax / ShibbolethIISAuthModule.cs
Created November 17, 2020 00:58
Shibboleth IIS Authentication Module
/***
* Shibboleth IIS Authentication Module
*
* This module is responsible for taking two attributes from Shibboleth
* (uid, memberOf) and using them to construct a user principal that
* can be used in IIS authorization rules. Add the generated DLL to
* either the GAC or the web site's Bin folder and reference it in the
* Modules configuration for IIS.
***/
@haliphax
haliphax / nc-a11y-styles.user.css
Last active September 16, 2020 22:10
Nexus Clash Accessible User Styles
/*
When importing this into Stylus, the name of the User Style is used
for URL matching. As such, use this name for the sylesheet:
www.nexusclash.com/modules.php?name=Game
*/
input, select, textarea {
background-color: #000;
border: 1px solid #000;
@haliphax
haliphax / nc-imp-char-sel-b4.user.js
Last active September 8, 2020 18:10
Nexus Clash Improved Character Select (B4) UserScript
// ==UserScript==
// @name Nexus Clash Improved Character Select (B4)
// @namespace https://roadha.us
// @version 0.2
// @description Adds colored resource bars and highlights characters according to certain conditions
// @author haliphax
// @match https://www.nexusclash.com/modules.php?name=Game*
// ==/UserScript==
(function() {
@haliphax
haliphax / nc-minimap-b4.user.js
Last active December 16, 2020 21:25
Nexus Clash Mini-Map (B4)
// ==UserScript==
// @name Nexus Clash Mini-Map (B4)
// @namespace https://roadha.us
// @author haliphax
// @version 1.1
// @description Adds a mini-map below the standard map view which can be clicked to toggle a full-sized plane map
// @include https://www.nexusclash.com/modules.php?name=Game*
// ==/UserScript==
(function () {