Skip to content

Instantly share code, notes, and snippets.

@ps2goat
ps2goat / shrink-ws.css
Created Dec 5, 2020
Shrink whitespace for printouts
View shrink-ws.css
/* place in a the head tag of html
It will remove all ridiculous page break directions, overflows, and inline-block display types, which cause issues.
Then re-applies hiding to elements that need it. could be better but works /shrug
Originally used on a health site's receipt page that was 3 pages long but should have fit on 1 page at 100% scale.
*/
<style type="text/css">
@media print {
* {
page-break-before: avoid!important;
page-break-after: avoid!important;
View Get IAM token for AWS Kubernetes
# uses the aws iam authenticator to generate a token and store the result in a variable,
# then set the result's value into the clipboard for pasting.
# Replace the values in square brackets (including the brackets) with the correct values.
$x = aws-iam-authenticator token -i [your cluster name] -r [your assumed iam role name] | ConvertFrom-Json; Set-Clipboard -Value ($x.status.token)
@ps2goat
ps2goat / gist:bf06ff3592d6752e433292ec257a1fda
Last active Oct 11, 2018
PowerShell script to clean up docker images from a list of images. Use `docker image prune` for the built-in functionality.
View gist:bf06ff3592d6752e433292ec257a1fda
docker images | Select-String -Pattern ' (?<sha>\b[a-zA-Z0-9]{12})\b ' | foreach {docker rmi --force $_.Matches.Groups[1].Value}