Skip to content

Instantly share code, notes, and snippets.

@anshumanb
anshumanb / npm.js
Last active May 25, 2022 00:35
Call NPM from Node
#!/usr/bin/env node
import { spawnSync } from "child_process";
spawnSync("npm", ["--version"], {
encoding: "utf-8",
shell: true,
stdio: [process.stdin, process.stdout, process.stderr],
cwd: process.cwd(),
});
@anshumanb
anshumanb / keybindings.json
Last active May 25, 2022 00:54
VSCode setup
[
{
"key": "ctrl+shift+i",
"command": "editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
{
"key": "shift+alt+f",
"command": "-editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
@anshumanb
anshumanb / config.yml
Last active May 25, 2022 12:38
Github CLI settings
# What protocol to use when performing git operations. Supported values: ssh, https
git_protocol: https
# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.
editor: vim
# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled
prompt: enabled
# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager.
pager:
# Aliases allow you to create nicknames for gh commands
aliases:
@anshumanb
anshumanb / psreadline-disabled-fix.reg
Created July 19, 2022 23:36
Re-enable PSReadLine when PowerShell disables it
Windows Registry Editor Version 5.00
; https://serverfault.com/questions/1014754/cause-of-warning-powershell-detected-that-you-might-be-using-a-screen-reader-an
[HKEY_CURRENT_USER\Control Panel\Accessibility\Blind Access]
"On"="0"