Skip to content

Instantly share code, notes, and snippets.

@hlian
Created February 29, 2012 22:32
Show Gist options
  • Save hlian/1945011 to your computer and use it in GitHub Desktop.
Save hlian/1945011 to your computer and use it in GitHub Desktop.
powershell profile!
function Check-Resolve {
hg resolve -l | ForEach-Object { Select-String '<<<' $_.Split()[1] }
}
Set-Alias cr Check-Resolve
function Grep-Service($regex) {
Get-Service | ? { $_.Name -match $regex }
}
Set-Alias gs Grep-Service
function Kill-Python {
ps python | kill
}
Set-Alias kpy Kill-Python
function Clear-Largefiles {
rm -Recurse C:\Users\hao\AppData\Local\largefiles
}
Set-Alias cl Clear-Largefiles
function Install-Mercurial {
pushd \code\hg
python setup.py install
popd
}
Set-Alias im Install-Mercurial
Remove-Item alias:cd
Set-Alias cd C:\Users\hao\Documents\WindowsPowerShell\Change-Directory.ps1
# For subrepos.
$env:Path += ';C:\Program Files (x86)\Git\bin'
# For me.
$env:Path += ";C:\Program Files (x86)\Programmer's Notepad"
$env:Path += ';C:\Users\hao\Desktop\apache-maven-3.0.3\bin'
$env:Path += ';C:\code\wasabi\Wasabi\bin\Release'
function Build-Plugin($tag) {
pushd \code\kiln\devel\plugin
hg up $tag
.\build
popd
}
Set-Alias bp Build-Plugin
function Run-Backend {
python \code\kiln\devel\backend\kiln\testserver.py
}
Set-Alias rb Run-Backend
function Unstash {
hg qpush; hg qref -X.; hg qpop -f
}
function Kiln-Status {
pushd \code\kiln\devel\website
echo "WEBSITE"
echo "======="
hg par; hg st; hg qser
popd
echo "`nBACKEND"
echo "======="
pushd \code\kiln\devel\backend
hg par; hg st; hg qser
popd
echo "`nPLUGIN"
echo "======"
pushd \code\kiln\devel\plugin
hg par; hg st; hg qser
popd
echo "`nINSTALLER"
echo "========="
pushd \code\kiln\devel\installer
hg par; hg st; hg qser
popd
echo "`nMULTIMIGRATOR"
echo "========="
pushd \code\kiln\devel\multimigrator
hg par; hg st; hg qser
popd
}
function Build-Kiln-Silent {
$iscc = "C:\Program Files (x86)\Inno Setup 5\ISCC.exe"
& $iscc kilnsilent.iss /o..\build\installer\ /dVERSION="" /dFOGBUGZVERSION=""
}
function Super-Hg {
$rest = $args[0..($args.Length - 2)]
$repos = $args[$args.Length - 1].split(' ')
foreach ($repo in $repos) {
Write-Host $rest $repo
pushd ..\$repo
& hg @rest
popd
}
}
Set-Alias ks Kiln-Status
Set-Alias bk Build-Kiln-Silent
Set-Alias shg Super-Hg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment