Skip to content

Instantly share code, notes, and snippets.

@jamestelfer
jamestelfer / branch-cleanup.bash
Last active September 10, 2020 12:21
Cleanup local branches that will be pruned from remote
# clean up local branches that have been removed from the remote, then prune the remote branches too
# only run on master
[ "$(git branch --show-current)" = "master" ] \
&& git branch --merged \
| grep -vw master \
| xargs -n 1 git branch -d \
&& git remote prune origin
@jamestelfer
jamestelfer / powershell-ondemand-module.ps1
Created November 1, 2018 09:39
Create an on-demand PowerShell module that re-registers when executed, suitable for download and execution via iwr/iex
# expected to be downloaded and executed on demand
# useful when http is convenient but a nuget host isn't
# iwr <url of script> | iex
Remove-Module 'ModuleNameHere' -ErrorAction 'SilentlyContinue'
New-Module -Name 'ModuleNameHere' -ScriptBlock {
$ErrorActionPreference = 'Stop'
@jamestelfer
jamestelfer / chocolatey.log
Created December 19, 2016 13:35
Choco error showing integer overflow
2016-12-05 16:55:33,083 [DEBUG] - Configured chocolatey.infrastructure.logging.log4net.config.xml from assembly choco, Version=0.10.3.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb
2016-12-05 16:55:33,083 [DEBUG] - Configured chocolatey.infrastructure.logging.log4net.config.xml from assembly choco, Version=0.10.3.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb
2016-12-05 16:55:33,098 [DEBUG] - XmlConfiguration is now operational
2016-12-05 16:55:33,176 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\config".
2016-12-05 16:55:33,286 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\config\chocolatey.config.update"
to "C:\ProgramData\chocolatey\config\chocolatey.config".
2016-12-05 16:55:33,286 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\config\chocolatey.config.update".
2016-12-05 16:55:33,302 [INFO ] - ============================================================
2016-12-05 16:55:33,302 [INFO ] - Chocolatey v0.10.3
2016-12-05 16:55:33,317 [DEBUG] - Chocola