Create a gist now

Instantly share code, notes, and snippets.

@toenuff /profile.ps1
Last active Aug 29, 2015

What would you like to do?
PowerShell Profile
(("1*0x26*1x3*2x4*3x1*4x1*2x2*1x1*2x1*4x4*3x3*2x21*1x1*0x20*1x1*2x2*4x3*5x5*6x2*7x6*1x2*8x5*6x3*5x2*4x1*2x15*1x1*0x17*1x1*2x1*4x1*5x10*6x2*7x1*1x1*9x4*1x1*10x1*1x2*8x10*6x1*5x1*4x1*2x13*1x1*0x16*1x1*4x12*6x2*7x2*1x1*11x1*8x2*5x1*7x1*11x2*1x2*8x12*6x1*4x11*1x1*0x14*1x1*2x1*7x12*6x2*7x3*1x1*9x1*12x2*13x1*14x1*10x3*1x2*8x12*6x1*8x1*2x9*1x1*0x14*1x1*7x13*6x2*9x4*1x2*8x2*7x5*1x2*10x13*6x1*8x9*1x1*0x12*1x1*4x15*6x2*8x4*1x1*9x2*15x1*10x4*1x2*7x15*6x1*4x7*1x1*0x11*1x1*4x17*6x2*8x2*1x1*7x1*1x2*16x1*1x1*8x2*1x2*7x17*6x1*4x7*1x1*0x10*1x1*4x19*6x2*8x1*7x6*1x1*8x2*7x19*6x1*4x5*1x1*0x9*1x1*2x1*6x1*7x1*11x10*6x1*7x1*8x6*6x1*9x3*1x1*7x1*8x3*1x1*10x6*6x1*7x1*8x10*6x1*11x1*8x1*6x1*2x5*1x1*0x9*1x1*11x1*7x1*1x1*11x1*6x1*7x1*8x1*6x1*7x1*8x1*6x1*7x1*8x1*7x2*1x1*8x1*6x1*7x1*8x2*6x1*8x2*1x1*11x2*1x1*11x2*1x1*7x2*6x1*7x1*8x1*6x1*7x2*1x1*8x1*7x1*8x1*6x1*7x1*8x1*6x1*7x1*8x1*6x1*11x1*1x1*8x1*11x5*1x1*0x9*1x1*17x2*1x1*11x1*7x2*1x1*16x2*1x1*16x2*1x1*17x3*1x1*16x2*1x1*8x1*6x1*8x1*11x1*1x1*11x2*1x1*11x1*1x1*11x1*7x1*6x1*7x2*1x1*16x3*1x1*17x2*1x1*16x2*1x1*16x2*1x1*8x1*11x2*1x1*18x5*1x1*0x13*1x1*17x3*1x1*17x2*1x1*17x6*1x1*17x2*1x1*7x1*1x1*11x1*1x1*11x2*1x1*11x1*1x1*11x1*1x1*8x3*1x1*17x6*1x1*17x2*1x1*17x3*1x1*17x7*1x1*0x29*1x1*9x2*1x1*11x1*1x1*11x2*1x1*11x1*1x1*11x2*1x1*10x25*1x1*0x4*1x1*19x1*20x1*15x1*17x1*21x1*1x1*22x1*20x1*23x1*1x1*24x1*25x1*21x1*22x1*23x1*26x1*27x1*28x1*27x1*28x1*27x3*1x2*2x1*8x1*1x1*11x1*1x1*11x2*1x1*11x1*1x1*11x1*1x1*7x2*2x1*1x1*29x1*15x1*30x1*31x1*32x2*33x1*28x1*1x1*22x1*15x1*23x1*34x1*32x2*35x1*36x1*37x1*38x1*25x1*39x1*40x1*41x1*42x1*15x1*38x1*0x27*1x1*9x3*43x1*9x3*16x1*10x1*9x3*16x1*10x3*43x1*10x6*1x1*0x22*1x1*20x2*22x1*44x1*13x2*7x1*44x1*15x1*45x1*23x1*26x1*22x1*15x1*23x1*41x1*45x1*15x1*26x1*46x1*44x1*26x1*23x2*21x1*41x1*42x1*15x1*38x1*0" -split "x") -split "x"|%{ if ($_ -match "(\d+)\*(\d+)") { "$([char][int]("10T32T95T61T45T94T35T47T92T40T41T124T62T58T60T111T86T39T44T87T104T115T116T101T77T97T114T63T33T84T69T78T117T70T110T102T64T103T109T105T108T46T99T118T112T119T100" -split "T")[$matches[2]])" * $matches[1] } }) -join ""
$host.UI.RawUI.WindowTitle = "By the powershell of greyskull"
cd c:\dropbox\scripts
function prompt {
(get-date).ToString("HH:mm:ss") + " " + $(if (test-path variable:/PSDebugContext) { '[DBG]: ' } else { '' }) + 'PS ' + (Get-Location).ProviderPath + $(if ($nestedpromptlevel -ge 1) { '>>' }) + '> '
}
new-alias -Name git -Value 'C:\Program Files (x86)\Git\bin\git.exe' -Scope Global
new-alias -Name vi -Value 'C:\Program Files (x86)\Vim\vim74\vim.exe' -Scope Global
new-alias -Name python -Value 'C:\Anaconda\python.exe' -Scope Global
new-alias -Name perl -Value 'C:\perl64\bin\perl.exe' -Scope Global
function Octave {
C:\Octave\Octave3.6.4_gcc4.6.2\bin\octave.exe -i --line-editing
}
function Enable-Git {
Import-Module posh-git
Enable-GitColors
function Global:prompt {
$realLASTEXITCODE = $LASTEXITCODE
# Reset color, which can be messed up by Enable-GitColors
$Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor
Write-Host ( (get-date).ToString("HH:mm:ss") + " " + $(if (test-path variable:/PSDebugContext) { '[DBG]: ' } else { '' }) + 'PS ' + (Get-Location).ProviderPath) -nonewline
Write-VcsStatus
$global:LASTEXITCODE = $realLASTEXITCODE
return "> "
}
}
Enable-Git
function Disable-Git {
if (Get-Module posh-git) {
Remove-Module posh-git
}
function Global:prompt {
(get-date).ToString("HH:mm:ss") + " " + $(if (test-path variable:/PSDebugContext) { '[DBG]: ' } else { '' }) + 'PS ' + (Get-Location).ProviderPath + $(if ($nestedpromptlevel -ge 1) { '>>' }) + '> '
}
}
function hgrep {
param(
[Parameter(Mandatory=$false, Position=0)]
[string]$Regex,
[Parameter(Mandatory=$false)]
[switch]$Full
)
$commands = get-history |?{$_.commandline -match $regex}
if ($full) {
$commands |ft *
}
else {
foreach ($command in ($commands |select -ExpandProperty commandline)) {
# This ensures that only the first line is shown of a multiline command
# You can always get the full command using get-history or you can fork and remove this from the gist
if ($command -match '\r\n') {
($command -split '\r\n')[0] + " ..."
}
else {
$command
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment