Skip to content

Instantly share code, notes, and snippets.

View Halkcyon's full-sized avatar
🦀

Maximilian Burszley Halkcyon

🦀
View GitHub Profile
# PSScriptAnalyzerSettings.psd1
# v1.17.1
@{
# This key overrides `Enable` in the `Rules` key
# 'ExcludeRules' = @('PSAvoidUsingWriteHost')
# This was not including all rules so I manually defined them in the `Rules` key
# 'IncludeRules' = @('*')
# CustomRulePath did not allow processing any other rules without this key enabled
{ /* vscode 1.27.1 */
"explorer.confirmDelete": false,
"liveshare.account": "",
"liveshare.accountProvider": "github",
"liveshare.nameTagVisibility": "Always",
"liveshare.showInStatusBar": "whileCollaborating",
"git.autofetch": true,
"git.confirmSync": false,
using namespace System.Management.Automation
#requires -Version 5
#requires -Module ActiveDirectory
[CmdletBinding()]
param
(
[Parameter(Position = 0)]
[Credential()]
@Halkcyon
Halkcyon / Select-ProxyFunction.ps1
Created November 26, 2018 16:22
Proxy function/alias for Select-Object
$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)
#requires -Version 5
<# Lasciate ogni speranza, voi ch'entrate #>
using namespace System.Diagnostics
using namespace System.DirectoryServices.AccountManagement
using namespace System.Management.Automation
using namespace System.Net
using namespace System.Security.Cryptography.X509Certificates
using namespace System.Security.Principal
using namespace System.Text
@Halkcyon
Halkcyon / settings.json
Last active April 1, 2019 11:58
vscode setup
{
"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 / 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' })]
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))
#header {
position: fixed;
width: 100vw;
top: 0;
}
.content {
margin-top: 70px;
}
@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