Skip to content

Instantly share code, notes, and snippets.

View trashbat's full-sized avatar

John Delaney trashbat

View GitHub Profile
@trashbat
trashbat / powershell.md
Last active October 14, 2019 11:19
PowerShell Learnings

Getting help for a command, e.g. Get-ChildItem:

Get-Help Get-ChildItem

Using behind corporate proxy - suggest putting in your profile script (see below):

[System.Net.WebRequest]::DefaultWebProxy = New-Object System.Net.WebProxy('<address>:<port>')
@trashbat
trashbat / powershell.md
Created October 11, 2019 08:29
PowerShell Learnings
  • Create new profile: New-Item $Profile -Type File -Force
  • Check if file exists: Test-Path <file>
  • Reload profile: iex $Profile
@trashbat
trashbat / vscode_shortcuts.md
Last active October 4, 2019 14:16
VS Code shortcuts

Shortcuts that I find useful (WIP):

  • Ctrl+P: Find a file
  • Alt+Z: Toggle word wrap
@trashbat
trashbat / gist:70cffc597f80650ee2d8
Created May 27, 2015 13:47
Display current git branch in bash prompt
__has_parent_dir () {
# Utility function so we can test for things like .git/.hg without firing up a
# separate process
test -d "$1" && return 0;
current="."
while [ ! "$current" -ef "$current/.." ]; do
if [ -d "$current/$1" ]; then
return 0;
fi