Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀

Maximilian Burszley Halkcyon

🦀
View GitHub Profile
@Halkcyon
Halkcyon / wrapper.cmd
Created Feb 9, 2021
A PowerShell Batch wrapper
View wrapper.cmd
# 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"
View cursive_generator.py
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 Dec 23, 2020
Creates a button to copy Reddit markdown to clipboard from Giphy for embedding gifs in Reddit comments.
View giphy-reddit.user.js
// ==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 Apr 19, 2020
Windows Terminal settings w/ Nord Theme and Nerd Fonts
View profiles.jsonc
// 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 Sep 17, 2019
My C# preferences
View .editorconfig
# 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
View reddit.css
#header {
position: fixed;
width: 100vw;
top: 0;
}
.content {
margin-top: 70px;
}
View prompt.ps1
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 Jun 24, 2019
Converts image file supported by GDI+ to an ASCII representation.
View i2a.ps1
#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' })]
View settings.json
{
"update.enableWindowsBackgroundUpdates": true,
"update.mode": "default",
"update.showReleaseNotes": false,
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"powershell.codeFolding.enable": true,
"powershell.codeFolding.showLastLine": false,
@Halkcyon
Halkcyon / Select-ProxyFunction.ps1
Created Nov 26, 2018
Proxy function/alias for Select-Object
View Select-ProxyFunction.ps1
$c = [System.Management.Automation.CommandMetadata]::new((Get-Command -Name Select-Object))
$c.Parameters.Remove('Property')
$p = [System.Management.Automation.ProxyCommand]::Create($c) -split "`n"
# -ExpandProperty
$p[12] = $p[12] -replace '(?<=Parameter\()', 'Position=0, '
${function:global:$} = [scriptblock]::Create($p)