Skip to content

Instantly share code, notes, and snippets.

View stevehjohn's full-sized avatar
📺
Emulating

Stevo John stevehjohn

📺
Emulating
View GitHub Profile
@stevehjohn
stevehjohn / profile.ps1
Last active September 23, 2023 15:48
Cmder Profile Script
# Init Script for PowerShell
# Created as part of cmder project
# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
# !!! Use "%CMDER_ROOT%\config\user_profile.ps1" to add your own startup commands
# Compatibility with PS major versions <= 2
if(!$PSScriptRoot) {
$PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path
}

Sample Input

root: (pppw) + 150
pppw: (600) / 4
cczh: 4 + (596)
lgvd: 2 * (298)
ptdq: (301) - 3
@stevehjohn
stevehjohn / sensors.cs
Created December 16, 2022 02:16
AoC 2022.15
for (var l = 0; l < _sensors.Count; l++)
{
var sensorL = _sensors[l];
for (var r = 1; r < _sensors.Count; r++)
{
var sensorR = _sensors[r];
var targetDelta = sensorL.ManhattanRange + sensorR.ManhattanRange + 2;
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/AutoCompleteSmartCompletion/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/ParenthesesInsertType/@EntryValue">None</s:String>
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/CSharpCompletingCharacters/UpgradedFromVSSettings/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeEditing/TypingAssist/BraceInsertType/@EntryValue">DISABLED</s:String>
<s:Boolean x:Key="/Default/CodeEditing/TypingAssist/SmartParenthEnabled/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/IdentifierHighlightingEnabled/@EntryValue">True</s:Boolean>
@stevehjohn
stevehjohn / powershell.ps1
Created January 31, 2019 13:55
Useful Poweshell Scripts
function Poll-For-Process {
while ($true) {
$date = Get-Date
Get-Process $args | ForEach-Object { "{0} {1}" -f $date, $_.ProcessName }
Start-Sleep -m 500
}
}
var lines = new[]
{
" _ _ _ _ _ _ _ _ ",
"| | | _| _||_||_ |_ ||_||_|",
"|_| ||_ _| | _||_| ||_| _|"
};
//var lines = new[]
//{
// " _ _ _ _ _ _ _ ",
// "|_||_|| ||_||_ | | ||_ ",
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Mirror Mirror on the Wall</title>
<link href='https://fonts.googleapis.com/css?family=Pacifico|Open+Sans' rel='stylesheet' type='text/css' />
<style>
body, h2, ul, li {
background-color: black;