Skip to content

Instantly share code, notes, and snippets.

@bnbdr
bnbdr / right_click_pw_to_cmd.ps1
Created February 22, 2019 16:29
Change powershell option to cmd in [shift]+[right-click] in folder background context menu
# run as admin
# install subinacl: https://download.microsoft.com/download/1/7/d/17d82b72-bc6a-4dc8-bfaa-98b37b22b367/subinacl.msi
$subinacl_path="C:\Program Files (x86)\Windows Resource Kits\Tools\subinacl.exe"
$cmd_path = "HKEY_CLASSES_ROOT\Directory\shell\cmd"
$bg_cmd_path = "HKEY_CLASSES_ROOT\Directory\Background\shell\cmd"
$pwsh_path = "HKEY_CLASSES_ROOT\Directory\shell\Powershell"
$bg_pwsh_path = "HKEY_CLASSES_ROOT\Directory\Background\shell\Powershell"
@bnbdr
bnbdr / 010.xml
Created May 14, 2018 10:57
010 maintenance
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Description>Scheduled maintenance</Description>
<URI>\010</URI>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<StartBoundary>2018-05-10T13:00:08</StartBoundary>
<Enabled>true</Enabled>
@bnbdr
bnbdr / keybindings.json
Created April 27, 2018 14:59
VSCode keybindings
{ "key": "ctrl+w", "command": "-workbench.action.closeWindow", "when": "!editorIsOpen" }
@bnbdr
bnbdr / todo.h
Created April 27, 2017 11:17
Todo macro for C/C++ (MS)
#ifdef _MSC_VER // only supports MS
#define TODO_STRINGIFY2(x) #x
#define TODO_STRINGIFY(x) TODO_STRINGIFY2(x)
#define OUTMSG_LINE_INFO "["__FILE__"]"__FUNCTION__"::(" TODO_STRINGIFY(__LINE__) ")"
#define OUT_MSG(PFX, msg) __pragma(message( PFX" > "##OUTMSG_LINE_INFO ##" | " msg))
#define TODO(msg) OUT_MSG("TODO", msg)
#define FIX(msg) OUT_MSG("FIX", msg)
// add more here...