Skip to content

Instantly share code, notes, and snippets.

View smartpcr's full-sized avatar

Xiaodong Li smartpcr

  • Microsoft
  • Redmond, WA
View GitHub Profile
@smartpcr
smartpcr / vs code keyboard bindings
Created June 5, 2020 19:20
vs code keyboard bindings
[
{
"key": "ctrl+k ctrl+d",
"command": "editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+k ctrl+c",
"command": "editor.action.addCommentLine",
"when": "editorTextFocus && !editorReadonly"
@smartpcr
smartpcr / terminal settings
Created June 5, 2020 09:31
windows new terminal settings
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@smartpcr
smartpcr / vscode
Created June 5, 2020 09:18
vs code settings
{
"editor.tabSize": 4,
"prettier.tabWidth": 4,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
"window.zoomLevel": 1,
"git.enableSmartCommit": true,
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
@smartpcr
smartpcr / cloudSettings
Created December 22, 2018 18:19
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-12-22T18:19:00.946Z","extensionVersion":"v3.2.0"}
@smartpcr
smartpcr / cloudSettings
Last active January 10, 2020 19:53
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-01-10T19:53:20.296Z","extensionVersion":"v3.4.3"}
# Go development
export GOPATH="${HOME}/.go"
export GOROOT="/usr/local/opt/go/libexec"
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
test -d "${GOPATH}" || mkdir "${GOPATH}"
test -d "${GOPATH}/src/github.com" || mkdir -p "${GOPATH}/src/github.com"
# Path to your oh-my-zsh installation.
export ZSH=/Users/xd/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="random"
# Uncomment the following line to use case-sensitive completion.
netstat -nao | find "8001"
tasklist /FI "PID eq 4"
param(
[string]$imageToRemove = "",
[string]$containersToRemove = ""
)
Write-Host "Checking existing docker containers..."
$containers = Invoke-Expression "docker ps -q"
if ($containersToRemove -and $containersToRemove.Length -gt 0) {
$containers = Invoke-Expression "docker ps -q --filter `"$containersToRemove`""
}