Skip to content

Instantly share code, notes, and snippets.

View HeyItsGilbert's full-sized avatar

Gilbert Sanchez HeyItsGilbert

View GitHub Profile
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Schema for validating label groups configuration files.",
"properties": {
"LABELGROUPS": {
"type": "array",
"description": "A list of label groups.",
"items": {
"type": "object",
@HeyItsGilbert
HeyItsGilbert / Module.Tests.ps1
Created March 12, 2025 18:47
PSWednesday Pester Containers Demo
param(
[Parameter(Mandatory = $true)]
$Module
)
Describe "<_.Name>" -ForEach $Module {
It 'Has a version' {
$_.version | Should -BeOfType [version]
}
It 'Has a description' {
$_.description | Should -BeOfType [String]
@HeyItsGilbert
HeyItsGilbert / cd.ps1
Last active January 14, 2025 20:52 — forked from nohwnd/cd.ps1
cd that: 1) navigates to parent folder when given a file path; 2) supports cd - to pop; 3) supports multiple parent changes with 2+ `.`
function Set-LocationButBetter {
param (
[Parameter(
ValueFromPipeline,
ValueFromPipelineByPropertyName
)]
$Path
)
process {
@HeyItsGilbert
HeyItsGilbert / HastilyMadeDemo.ps1
Created December 12, 2024 03:55
Demo used during PowerShell Podecast
# Make a scriptblock
$scriptBlock = {
Write-Host "Hello World"
Get-Fighter -Chill -Name 'Jill'
Get-Fighter -Chill -Name 'Gilbert'
Get-Fighter -Name 'Andrew'
Write-Host "Fighter ready."
}
# Surprise! It's all scriptblocks!
@HeyItsGilbert
HeyItsGilbert / keybase.md
Created October 9, 2024 21:50
keybase.md

Keybase proof

I hereby claim:

  • I am heyitsgilbert on github.
  • I am heyitsgilbert (https://keybase.io/heyitsgilbert) on keybase.
  • I have a public key ASDHmoTdH2KH_cVpALRyPWR5b-5D2lYKqHq9jNlzMkY9mwo

To claim this, I am signing this object:

@HeyItsGilbert
HeyItsGilbert / colortest.ps1
Last active April 17, 2024 13:23
Colortest for PowerShell
$T='gYw' # The test text
Write-Host " 40m 41m 42m 43m 44m 45m 46m 47m"
$fgs = @(
' m',
' 1m',
' 30m',
'1;30m',
' 31m',
@HeyItsGilbert
HeyItsGilbert / resume.json
Last active September 16, 2024 17:56
resume.json
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"meta": {
"version": "v1.0.0",
"canonical": "https://github.com/jsonresume/resume-schema/blob/v1.0.0/schema.json",
"theme": "elegant"
},
"basics": {
"name": "Gilbert Sanchez",
"label": "Señor Systems Engineer",
@HeyItsGilbert
HeyItsGilbert / ShellIntegration.ps1
Created July 17, 2023 23:12 — forked from mdgrs-mei/ShellIntegration.ps1
Adds escape codes to the prompt for the shell integration
# Reference:
# https://devblogs.microsoft.com/commandline/shell-integration-in-the-windows-terminal/
param
(
[ValidateSet('WindowsTerminal', 'ITerm2')]
[String]$TerminalProgram = 'WindowsTerminal'
)
# Restore hooked functions in case this script is executed accidentally twice
homeassistant:
container_name: hass-core
restart: unless-stopped
image: homeassistant/home-assistant:0.113.3
#network_mode: host
networks:
- t2_proxy
- iot
ports:
- "8123:8123"

Keybase proof

I hereby claim:

  • I am HeyItsGilbert on github.
  • I am heyitsgilbert (https://keybase.io/heyitsgilbert) on keybase.
  • I have a public key whose fingerprint is B402 E660 D362 95EC F092 CB08 F472 C90E 263B 7EF9

To claim this, I am signing this object: