Skip to content

Instantly share code, notes, and snippets.

@phense
phense / Backup Notes.cmd
Created August 8, 2023 06:11
Powershell embedded in .CMD File; automatic git commit - pull - push
@@:: This prolog allows a PowerShell script to be embedded in a .CMD file.
@@:: Any non-PowerShell content must be preceeded by "@@"
@@setlocal
@@set POWERSHELL_BAT_ARGS=%*
@@if defined POWERSHELL_BAT_ARGS set POWERSHELL_BAT_ARGS=%POWERSHELL_BAT_ARGS:"=\"%
@@PowerShell -ExecutionPolicy Bypass -Command Invoke-Expression $('$args=@(^&{$args} %POWERSHELL_BAT_ARGS%);'+[String]::Join(';',$((Get-Content '%~f0') -notmatch '^^@@'))) & goto :EOF
Set-Location -Path "C:\Users\peter\Repositories\notes.git\"
$gstatus = git status --porcelain
$numberOfChanges = ($gstatus | Measure-Object).Count
@phense
phense / keyboard-layout.json
Created August 9, 2022 21:58
Elite Keyboard Layout
[
{
"backcolor": "#000000",
"name": "Razor Blackwidow Tournament 2014",
"author": "CMDR. Nitromaroder",
"radii": "10px",
"pcb": false
},
[
{
@phense
phense / afk_timer_v2.ahk
Last active February 12, 2022 14:57
ahk-snippets #code
#Persistent ; Use this directive to prevent the script from exiting after the auto-execute
; section (top part of the script) completes. This is useful in cases where a
; script contains timers and/or custom menu items.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
F9::
Stop := 0
Loop {