Last active
December 30, 2023 23:45
Revisions
-
y0mbo revised this gist
Dec 30, 2023 . 1 changed file with 62 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -86,21 +86,6 @@ Function Edit-Vimrc vim $home\_vimrc } function grep { Write-Output "You're looking for this command: Select-String -Pattern ""error"" -Path ""C:\temp\log\*.log\""" if ($args[0]) { @@ -113,4 +98,66 @@ function grep { Select-String -Pattern ($search) -Path ($path) } } function journal { param ( [string]$date ) if (!$date) { $date = Get-Date -Format "yyyy-MM-dd" } $file = "$date-journal.md" if (Test-Path -Path $file -PathType Leaf) { Write-Host "$file already exists." notepad $file } else { New-Item -Name $file -ItemType File -Force > $null $header = "---", "slug: $date-journal", "title: $date", "author: John Uhri", "description: >-", "`t$date Journal Entry", "keywords:", "`t- journal", "banner:", "bannerCredit", "---`n" $header | Set-Content -Path "$file" Write-Host "$file created." notepad $file } } function notepad { Start-Process -FilePath "C:\Program Files (x86)\Notepad++\notepad++.exe" $args[0] } # to reload your PowerShell profile function reload { . $profile Write-Host "$profile reloaded" } # techie007 post, last comment https://superuser.com/questions/502374/equivalent-of-linux-touch-to-create-an-empty-file-with-powershell function touch { if(!$args[0]) { Write-Output "You forgot to provide a file name, so I can't create anything." continue } if((Test-Path -Path ($args[0])) -eq $false) { Set-Content -Path ($args[0]) -Value ($null) } else { (Get-Item ($args[0])).LastWriteTime = Get-Date } } -
y0mbo revised this gist
Dec 30, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # Powershell Profile # Last change: 2023-12-30 # Location: # > $PROFILE # C:\Users\johnu\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 -
y0mbo revised this gist
Oct 6, 2022 . 1 changed file with 17 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ # Select "Y"1 # https://tecadmin.net/powershell-running-scripts-is-disabled-system/ $Title = "I am one with the code and the code is with me" $host.UI.RawUI.WindowTitle = $Title function title($value) { @@ -43,7 +43,7 @@ Set-Alias -Name gca -Value git-commit-all # going to force remove gc from Get-Content and use it for Git instead # https://stackoverflow.com/questions/24882210/how-do-i-remove-or-replace-a-built-in-alias-in-powershell if (Test-Path alias:gc) { del alias:gc -Force } function git-commit-m { git commit -m $args } Set-Alias -Name gc -Value git-commit-m @@ -86,7 +86,7 @@ Function Edit-Vimrc vim $home\_vimrc } # to reload your PowerShell profile function reload { & $profile } @@ -100,3 +100,17 @@ function touch { (Get-Item ($args[0])).LastWriteTime = Get-Date } } function grep { Write-Output "You're looking for this command: Select-String -Pattern ""error"" -Path ""C:\temp\log\*.log\""" if ($args[0]) { Write-Output "... but let me 'grep' that for you anyway" $search = $args[0] $path = "*.*" if ($args[1]) { $path = $args[1]} Select-String -Pattern ($search) -Path ($path) } } -
y0mbo revised this gist
Nov 10, 2021 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -86,6 +86,11 @@ Function Edit-Vimrc vim $home\_vimrc } # reload your PowerShell profile function reload { & $profile } # techie007 post, last comment https://superuser.com/questions/502374/equivalent-of-linux-touch-to-create-an-empty-file-with-powershell function touch { if((Test-Path -Path ($args[0])) -eq $false) { -
y0mbo revised this gist
Nov 10, 2021 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,6 +55,11 @@ Set-Alias -Name gf -Value git-fetch function back-dir { cd .. } Set-Alias -Name .. -Value back-dir function back-dir2 { cd ../.. } Set-Alias -Name ... -Value back-dir2 function back-dir3 { cd ../../.. } Set-Alias -Name .... -Value back-dir3 # turn off that annoying beep Set-PSReadlineOption -BellStyle None @@ -89,4 +94,4 @@ function touch { else { (Get-Item ($args[0])).LastWriteTime = Get-Date } } -
y0mbo revised this gist
Nov 5, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,6 +42,7 @@ function git-commit-all { git commit -am $args } Set-Alias -Name gca -Value git-commit-all # going to force remove gc from Get-Content and use it for Git instead # https://stackoverflow.com/questions/24882210/how-do-i-remove-or-replace-a-built-in-alias-in-powershell del alias:gc -Force function git-commit-m { git commit -m $args } Set-Alias -Name gc -Value git-commit-m -
y0mbo revised this gist
Nov 5, 2021 . 1 changed file with 29 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,14 +26,40 @@ function prompt { # git aliases # see https://gist.github.com/dunckr/8334213 function git-branch { git branch $args } Set-Alias -Name gb -Value git-branch function git-add { git add $args } Set-Alias -Name ga -Value git-add function git-diff { git diff $args } Set-Alias -Name gd -Value git-diff function git-status { git status } Set-Alias -Name gs -Value git-status function git-commit-all { git commit -am $args } Set-Alias -Name gca -Value git-commit-all # going to force remove gc from Get-Content and use it for Git instead del alias:gc -Force function git-commit-m { git commit -m $args } Set-Alias -Name gc -Value git-commit-m function git-checkout { git checkout $args } Set-Alias -Name gco -Value git-checkout function git-fetch { git fetch } Set-Alias -Name gf -Value git-fetch function back-dir { cd .. } Set-Alias -Name .. -Value back-dir # turn off that annoying beep Set-PSReadlineOption -BellStyle None # set up vim for editing $VIMPATH = "c:\Program Files\Vim\vim82\" $VIM = $VIMPATH + "vim.exe" $GVIM = $VIMPATH + "gvim.exe" @@ -62,4 +88,4 @@ function touch { else { (Get-Item ($args[0])).LastWriteTime = Get-Date } } -
y0mbo revised this gist
Sep 27, 2021 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,3 +53,13 @@ Function Edit-Vimrc { vim $home\_vimrc } # techie007 post, last comment https://superuser.com/questions/502374/equivalent-of-linux-touch-to-create-an-empty-file-with-powershell function touch { if((Test-Path -Path ($args[0])) -eq $false) { Set-Content -Path ($args[0]) -Value ($null) } else { (Get-Item ($args[0])).LastWriteTime = Get-Date } } -
y0mbo revised this gist
Apr 13, 2021 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,15 @@ # Powershell Profile # # Location: # > $PROFILE # C:\Users\johnu\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 # # If you get the error: "Running scripts is disabled on this system" when loading the Profile: # From a PowerShell window opened As Administrator: # > Set-ExecutionPolicy RemoteSigned # Select "Y"1 # https://tecadmin.net/powershell-running-scripts-is-disabled-system/ $Title = "I am one with the code and the code is with me." $host.UI.RawUI.WindowTitle = $Title -
y0mbo revised this gist
Dec 17, 2020 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,10 @@ $Title = "I am one with the code and the code is with me." $host.UI.RawUI.WindowTitle = $Title function title($value) { $host.UI.RawUI.WindowTitle = $value } Set-Location C:\dev\ function prompt { -
y0mbo revised this gist
Dec 15, 2020 . 1 changed file with 23 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,36 @@ Set-Location C:\dev\ function prompt { $p = Split-Path -leaf -path (Get-Location) "$p> " } # git aliases # see https://gist.github.com/dunckr/8334213 function git-status { git status } Set-Alias -Name gs -Value git-status # turn off that annoying beep Set-PSReadlineOption -BellStyle None # set up vim for editing $VIMPATH = "c:\Program Files (x86)\Vim\vim82\" $VIM = $VIMPATH + "vim.exe" $GVIM = $VIMPATH + "gvim.exe" Set-Alias vi $VIM Set-Alias vim $VIM Set-Alias gvim $GVIM # for editing your PowerShell profile Function Edit-Profile { vim $profile } # for editing your Vim settings Function Edit-Vimrc { vim $home\_vimrc } -
y0mbo revised this gist
Feb 22, 2020 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,18 @@ $host.ui.RawUI.WindowTitle = "Red Caffeine BadAss" Set-Location C:\dev\ function prompt { $p = Split-Path -leaf -path (Get-Location) "$p> " } # turn off that annoying beep Set-PSReadlineOption -BellStyle None # git aliases # see https://gist.github.com/dunckr/8334213 function git-status { git status } Set-Alias -Name gs -Value git-status # clear-host -
y0mbo revised this gist
Feb 11, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Set-Location C:\dev\ function prompt { $p = Split-Path -leaf -path (Get-Location) -
y0mbo revised this gist
Feb 11, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,5 +10,5 @@ function prompt { function git-status { git status } Set-Alias -Name gs -Value git-status # turn off that annoying beep Set-PSReadlineOption -BellStyle None -
y0mbo revised this gist
Feb 11, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,3 +9,6 @@ function prompt { # see https://gist.github.com/dunckr/8334213 function git-status { git status } Set-Alias -Name gs -Value git-status # turn off that onnoying beep Set-PSReadlineOption -BellStyle None -
y0mbo renamed this gist
Feb 6, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ Set-Location C:\dev\dev\ function prompt { $p = Split-Path -leaf -path (Get-Location) "$p> " -
y0mbo created this gist
Feb 6, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ function prompt { $p = Split-Path -leaf -path (Get-Location) "$p> " } # git aliases # see https://gist.github.com/dunckr/8334213 function git-status { git status } Set-Alias -Name gs -Value git-status