Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Halkcyon's full-sized avatar
🦀

Maximilian Burszley Halkcyon

🦀
View GitHub Profile
@Halkcyon
Halkcyon / main.rs
Created December 2, 2023 16:59
AOC 2023 Day 02
#![allow(dead_code)]
use std::{env::current_dir, fs};
use nom::{IResult, bytes::complete::{tag, take_until, take_while1}, branch::alt, multi::separated_list0};
pub fn main() -> color_eyre::Result<()> {
let pwd = current_dir()?;
let input = fs::read_to_string(pwd.join("input/y2023/d02.txt"))?;
@Halkcyon
Halkcyon / GW2.cmd
Last active March 1, 2022 17:30 — forked from OneFaced/UpdateArcDps.cmd
Automatically update ArcDps and BuildTemplates from deltaconnected for Guild Wars 2
# 2>NUL & powershell -nop -nol -ep bypass "gc -ra '%~f0'|iex" & EXIT /B
# ^ boilerplate to execute script from batch context
# Update this variable to where you have GW2 installed and named.
# This defaults to `C:\Program Files\`
[System.IO.FileInfo] $GW2_PATH = "$Env:ProgramFiles\Guild Wars 2\Gw2-64.exe"
# This line can be removed if you don't want to pass any arguments.
# It does not get used if you already have a
# `%APPDATA%\Guild Wars 2\Settings.json` file.
@Halkcyon
Halkcyon / wrapper.cmd
Created February 9, 2021 03:54
A PowerShell Batch wrapper
# 2>NUL & @CLS & PUSHD "%~dp0" & "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -nol -nop -ep bypass "[IO.File]::ReadAllText('%~f0')|iex" & POPD & EXIT /B
<#
@
Stops a command from echoing to the console host.
# 2>NUL & @CLS
This allows us to comment out the batch wrapper part from the powershell script and eats the cmd.exe error since # is not a command or control character.
PUSHD "%~dp0"
A_SCRIPT_CAPS = ord("\N{MATHEMATICAL BOLD SCRIPT CAPITAL A}")
A_SCRIPT_SMALL = ord("\N{MATHEMATICAL BOLD SCRIPT SMALL A}")
A_CAPS = ord('A')
A_SMALL = ord('a')
RANGE_CAPS = range(A_CAPS, A_CAPS+26)
RANGE_SMALL = range(A_SMALL, A_SMALL+26)
def cursive(s: str) -> str:
for i, v in enumerate(chars := list(map(ord, s))):
if v in RANGE_CAPS:
@Halkcyon
Halkcyon / giphy-reddit.user.js
Last active December 23, 2020 00:00
Creates a button to copy Reddit markdown to clipboard from Giphy for embedding gifs in Reddit comments.
// ==UserScript==
// @noframes
// @name giphy-reddit
// @namespace mburszley
// @description Creates a button to copy Reddit markdown to clipboard from Giphy for embedding gifs in Reddit comments.
// @grant clipboardWrite
// @match https://giphy.com/*
// @version 6
// @downloadURL https://gist.github.com/mburszley/1474687f8447495b3ea724c9ea97bebb/raw/giphy-reddit.user.js
// @updateURL https://gist.github.com/mburszley/1474687f8447495b3ea724c9ea97bebb/raw/giphy-reddit.user.js
@Halkcyon
Halkcyon / profiles.jsonc
Created April 19, 2020 22:34
Windows Terminal settings w/ Nord Theme and Nerd Fonts
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"confirmCloseAllTabs": false,
"requestedTheme": "dark",
"wordDelimiters": " _/\\()\"'-.,:;<>~!@#$%^&*|+=[]{}~?\u2502",
"profiles": {
"defaults": {
@Halkcyon
Halkcyon / .editorconfig
Created September 17, 2019 15:54
My C# preferences
# https://editorconfig.org/#supported-properties
# https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2017#supported-settings
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
#header {
position: fixed;
width: 100vw;
top: 0;
}
.content {
margin-top: 70px;
}
function prompt {
@"
`e[38;2;148;152;0m`n{0}
`e[m/{1}/
`e[38;5;21mPS `e[m`e[1m`e[4m {2} `e[m `e[38;5;208m{3}`e[38;5;92m{4} `e[m
"@ -f @((Get-Date -UFormat '%Y-%m-%d %H:%M:%S')
$PWD.Drive.Name.ToUpper()
((Get-History).Count + 1).ToString('000')
($PWD.ProviderPath.ToLower().Replace($HOME, '~').Replace('\', '/') -replace '\w:' -replace '/$') + '/'
'>' * ($NestedPromptLevel + 1))
@Halkcyon
Halkcyon / i2a.ps1
Last active June 24, 2019 16:32
Converts image file supported by GDI+ to an ASCII representation.
#TODO: Add support for URIs
function Convert-ImageToAscii {
[Alias('i2a')]
[OutputType([string])]
[CmdletBinding()]
param(
[Parameter(Mandatory, Position = 0, ValueFromPipeline)]
[ValidateScript({ $PSItem.Exists -and
$PSItem.Extension -in '.bmp', '.gif', '.jpeg', '.jpg', '.png', '.tiff' })]