export MY_BRANCH=feat/DC1121-7769
git switch $MY_BRANCH
if [ "$(git branch --show-current)" = "$MY_BRANCH" ]; then
echo "✅ You are on branch: $MY_BRANCH"
else
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Interval in seconds (e.g., 300 = 5 minutes) | |
INTERVAL=300 | |
echo "Keeping Codespace alive. Press [CTRL+C] to stop." | |
while true; do | |
echo "Ping at $(date)" > /tmp/keepalive.txt | |
sleep $INTERVAL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Send all PDFs in the current folder via Outlook | |
# Save as: Send-PDFs.ps1, then run it from the folder containing the PDFs. | |
Set-StrictMode -Version Latest | |
$ErrorActionPreference = 'Stop' | |
$recipient = 'mamatucci@gmail.com' | |
$subject = "PDFs $(Get-Date -Format 'yyyy-MM-dd HH:mm')" | |
$body = "Hi,`r`n`r`nPlease find attached all PDF files from: $(Get-Location).`r`n`r`nSent automatically via PowerShell.`r`n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates a dated subfolder in the current directory, adds a readme.md file if missing, and compresses the entire folder into a ZIP backup. Includes error handling for the backup process. | |
$currentDate = (Get-Date).ToString("yyMMdd") | |
# TODO: check backupFilePath | |
$backupFilePath = "$env:USERPROFILE\.bkp\$currentDate.zip" | |
$currentDirectory = Get-Location | |
$datedSubfolderPath = Join-Path -Path $currentDirectory -ChildPath $currentDate | |
$readmeFilePath = Join-Path -Path $datedSubfolderPath -ChildPath "readme.md" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone --depth 1 --branch main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if a project ID was provided | |
if [[ "$1" == "--help" || "$1" == "-h" ]]; then | |
echo "Usage: $(basename "$0") <gcp_project_id>" | |
echo "This script authenticates and configures gcloud for the specified GCP project." | |
exit 0 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import sys | |
import requests | |
from pathlib import Path | |
REPO = "paths_" | |
WKHTMLTOPDF_PATH = r"C:\git\py_fetch_skillboost\wkhtmltox\bin\wkhtmltopdf.exe" | |
def fetch_and_save_html(path_id, input_path_html): | |
url = f"https://partner.cloudskillsboost.google/paths/{path_id}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from yt_dlp import YoutubeDL | |
import os | |
import json | |
import html | |
import re | |
import http.server | |
import socketserver | |
import threading | |
# Directory to store videos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync -avz --exclude='.git/' --exclude='.venv/' --exclude='__pycache__' --exclude='.pytest_cache' ./kb.oreilly.git/ /mnt/c/Users/mario/Dropbox/kb.oreilly.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name "*.Identifier" -type f -print0 | xargs -0 rm |
NewerOlder