Skip to content

Instantly share code, notes, and snippets.

@PJB3005
Last active August 21, 2017 10:43
Show Gist options
  • Save PJB3005/aa04d4db91a9b56d4b1ea10d875a1e3d to your computer and use it in GitHub Desktop.
Save PJB3005/aa04d4db91a9b56d4b1ea10d875a1e3d to your computer and use it in GitHub Desktop.
dotfiles
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
Import-Module posh-git
# Set up a simple prompt, adding the git prompt parts inside git repos
function global:prompt {
$realLASTEXITCODE = $LASTEXITCODE
Write-Host($pwd.ProviderPath) -nonewline -ForeGroundColor green
Write-VcsStatus
$global:LASTEXITCODE = $realLASTEXITCODE
"`n> "
}
Pop-Location
Start-SshAgent -Quiet
function Resize-Gif($file, $out, $size) {
gifsicle $file, --resize $size -o $out | Write-Host
}
function Resize-Image($file, $size, $out) {
magick $file -interpolate Nearest -filter point -resize $size $out
}
function Reload-Profile {
. $PROFILE
}
function Push-Origin() {
$branchname = (git rev-parse --abbrev-ref HEAD)
git push --set-upstream origin $branchname
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment