Skip to content

Instantly share code, notes, and snippets.

@edumserrano
edumserrano / gist:5e878002c7dfb40d3126e28dbb29dd42
Last active December 18, 2023 18:40
Playwright clean up obsolete snapshots
# This script detects obsolete Playwright snapshots and automatically removes them.
# Obsolete snapshots are detected by re-generating the snapshots in a different folder and then
# comparing these two folders.
# To do this, we are taking advantage of the fact that development/pipeline snapshots
# are created using a Linux docker container, as we can re-generate the Playwright snapshots using
# the locally-installed version to have them automatically created in a separate folder (i.e. `linux` vs `windows`).
#
# This script will be required so long as Playwright does not have built-in functionality to detect and clean up
# obsolete snapshots.
# See: https://github.com/microsoft/playwright/issues/16582
@edumserrano
edumserrano / connect-to-aws-eks-cluster.ps1
Created May 12, 2020 22:08
Powershell script to connect to an aws eks cluster as part of a windows terminal profile
Param(
[Parameter(Mandatory=$true)][string ]$alias,
[Parameter(Mandatory=$true)][string ]$profile
)
$ThemeSettings.Options.ConsoleTitle = $false # disable window title from changing to reflect current directory (https://github.com/JanDeDobbeleer/oh-my-posh/issues/179)
aws eks update-kubeconfig --name apps --alias $alias --region us-east-1 --profile $profile
kubectx ls
Import-Module Get-ChildItemColor
Import-Module DockerCompletion
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme MyParadox
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
@edumserrano
edumserrano / MyParadox.psm1
Created April 10, 2020 14:03
Windows Terminal Powershell Posh Theme
#requires -Version 2 -Modules posh-git
function GetLastCommandExecutionTime() {
$history = Get-History -ErrorAction Ignore -Count 1
if ($history) {
$ts = New-TimeSpan $history.StartExecutionTime $history.EndExecutionTime
switch ($ts) {
{ $_.TotalSeconds -lt 1 } {
[int]$d = $_.TotalMilliseconds
$execTime = "{0}ms " -f ($d)
@edumserrano
edumserrano / settings.json
Last active May 17, 2020 21:52
Windows Terminal settings - profiles configuration
// This file was initially generated by Windows Terminal 0.11.1251.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// You can add more global application settings here.