git checkout main
git rebase -i --root
| { | |
| // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | |
| // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | |
| // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | |
| // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
| // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | |
| // Placeholders with the same ids are connected. | |
| // Example: | |
| // "Print to console": { | |
| // "scope": "javascript,typescript", |
| # Define output file | |
| $outputFile = "Subfolders.md" | |
| # Get current directory | |
| $currentDir = Get-Location | |
| # Get all subfolders | |
| $subfolders = Get-ChildItem -Path $currentDir -Directory | |
| # Start Markdown content |
Git is a version control system that helps developers track changes in their code and collaborate with others. This guide introduces common Git commands and workflows for beginners.
Initializes a new Git repository in your project folder. Example: git init
Copies an existing Git repository from a remote server (like GitHub) to your local machine. Example: git clone https://github.com/user/repo.git
| #!/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 |
| # 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" |
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| # 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" |
| git clone --depth 1 --branch main |
| #!/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 |