Skip to content

Instantly share code, notes, and snippets.

@timabell
timabell / assoc.ps1
Last active December 6, 2022 15:22
set windows file associations
# https://gist.github.com/timabell/bc90e0808ec1cda173ca09225a16e194
# MIT license
$exts=@(
"csv",
"csproj",
"json",
"log",
"md",
"patch",
"sql",
@johnkors
johnkors / git-prune-merged.ps1
Last active March 22, 2023 22:23
PowerShell script to delete branches merged to master
# update local list of pruned branches on the remote to local:
git fetch --prune
# delete branches on remote origin that have been merge to master
git branch --merged remotes/origin/master -r | %{$_.trim().replace('origin/', '')} | ?{$_ -notmatch 'master'} | %{git push --delete origin $_}
# delete local branches that have been merged to master
git branch --merged remotes/origin/master | %{$_.trim()} | ?{$_ -notmatch 'master'} | %{git branch -d $_}
# remove stale refs (local refs to branches that are gone on the remote)
@elado
elado / stop-gifs.js
Last active November 8, 2018 09:19
STOP ALL GIFS!!!!!! (bookmarklet)
javascript:(function(){function createElement(a,b){var c=document.createElement(a);return b(c),c}function f(a){var e,b=a.width,c=a.height,d=createElement("canvas",function(a){a.width=b,a.height=c}),f=0,g=function(){for(d.getContext("2d").drawImage(a,0,0,b,c),f=0;f<a.attributes.length;f++)e=a.attributes[f],'"'!==e.name&&d.setAttribute(e.name,e.value);d.style.position="absolute",a.parentNode.insertBefore(d,a),a.style.opacity=0};a.complete?g():a.addEventListener("load",g,!0)}function all(){return(new Array).slice.apply(document.images).map(f)}all();})()