Skip to content

Instantly share code, notes, and snippets.

@MarkKoz
MarkKoz / private-build-plans.toml
Created October 2, 2022 20:23
Custom build plans for Iosevka
[buildPlans.iosevka]
family = "Iosevka"
spacing = "normal"
serifs = "sans"
no-cv-ss = true
export-glyph-names = false
[buildPlans.iosevka.variants.design]
capital-a = "straight-serifless"
capital-b = "standard-serifless"
@MarkKoz
MarkKoz / fandom_userstyle.css
Last active February 27, 2022 05:07
A stylesheet that de-clutters fandom.com and makes it nicer to read in large windows.
.fandom-sticky-header {
/* Make the thin header always visible. */
transform: translateY(100%) !important;
/* Remove space left by hiding global navigation. */
left: 0px !important;
}
/* Make space for the sticky header including the original page margin. */
.page {
@MarkKoz
MarkKoz / export_svgs.sh
Last active June 7, 2020 06:38
Convert SVGs into PNGs using Inkscape
#!/usr/bin/env bash
#
# Convert SVGs into PNGs using Inkscape.
#
# PNGs are saved to the same location as their corresponding SVG files.
# If sizes are specified, they are appended to the names of the PNGs.
#
# The env var INKSCAPE_BIN can be set to configure the path to Inkscape.
#
# Usage: ./export_svgs.sh <input_path> [size [size]...]
@MarkKoz
MarkKoz / get_bnsbuddy.py
Created February 19, 2020 03:00
Downloads the latest binary for BnS Buddy, bypassing the updater application.
import shutil
import subprocess
from pathlib import Path
from tempfile import NamedTemporaryFile, TemporaryDirectory
import requests
UNRAR_PATH = r"C:\Program Files\WinRAR\UnRAR.exe"
@MarkKoz
MarkKoz / RegionChanger.ps1
Created May 14, 2019 03:38
LoL Client Region Changer
param(
[Parameter(Position=0, mandatory=$true)]
# [ValidateScript({$regions.ContainsKey($_)})]
[ValidateSet("NA", "LA1")]
[string]$Region,
[Parameter(Position=1, mandatory=$true)]
[ValidateScript({Test-Path $_})]
[string]$GameDir
)
@MarkKoz
MarkKoz / on_command_error.py
Last active December 30, 2020 00:01
Discord.py Rewrite Global Command Error Handler
async def on_command_error(
self,
ctx: commands.Context,
error: commands.CommandError
):
# Skips errors that were already handled locally.
if getattr(ctx, 'handled', False):
return
if isinstance(error, commands.NoPrivateMessage):
@MarkKoz
MarkKoz / 8mib.sh
Last active December 11, 2018 22:43
Uses ffmpeg to convert ShadowPlay recordings so that they can be uploaded to Discord
#!/bin/bash
#
# Uses ffmpeg to convert ShadowPlay recordings for uploading to Discord.
# Usage: ./8mib.sh <video_path> [seek_eof]
if [ ! -f "$1" ]; then
(>&2 echo "The video file could not be found.")
exit
fi
@MarkKoz
MarkKoz / aoc_2018_day_04.py
Last active December 4, 2018 10:45
AoC 2018 - Day 04
"""
Time to execute: 0.002147326900568627 seconds
Lines of code: 31
"""
from collections import defaultdict
with open('input.txt') as f:
log = f.read().splitlines()
log.sort(key=lambda e: e[:17])
@MarkKoz
MarkKoz / plugdj-playlist-api.md
Last active November 7, 2018 03:22
plug.dj Playlist API

Base URL: https://plug.dj/_

Response Object

Field Type Description
data array endpoint-specific return data
meta object unknown
status string unknown - success of the request?
time float unknown - time to process request?
@MarkKoz
MarkKoz / mci_cd_status.cpp
Last active November 4, 2018 03:33
MCI CD Drive Status
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <mmsystem.h>
#include <iostream>
int main()
{
MCI_OPEN_PARMS open_params;
::ZeroMemory(&open_params, sizeof(MCI_OPEN_PARMS));