It understands files such as:
## global definitions
global:
debug: yes
verbose: no
debugging:
detailed: no
header: "debugging started"| #!/bin/bash | |
| # 1. Ensure dependencies are installed and lockfile is consistent before dry run | |
| # 2. Simulate dependency updates | |
| # 3. Check for known security vulnerabilities | |
| # 4. Simulate deduplication | |
| set -euo pipefail | |
| pnpm install --frozen-lockfile |
| function Convert-PrefixToNetmask { | |
| param ( | |
| [Parameter(Mandatory = $true)] | |
| [int]$PrefixLength | |
| ) | |
| # Create a binary mask string with 1's for the prefix and pad with 0's | |
| $binaryMask = ("1" * $PrefixLength).PadRight(32, "0") | |
| $octets = @() | |
It understands files such as:
## global definitions
global:
debug: yes
verbose: no
debugging:
detailed: no
header: "debugging started"| # Reference https://stackoverflow.com/a/34407620/13287790 | |
| # Requires `jq` | |
| # $ echo -n "encode this" | jq -sRj @uri | |
| # encode%20this | |
| # MY_VAR=$(urlencode "encode this") | |
| echo -n "${1}" | jq -sRj @uri |
| # Clear all AWS related environment variables | |
| function awskill { | |
| Remove-Item -Path Env:AWS_DEFAULT_PROFILE -ErrorAction SilentlyContinue | |
| Remove-Item -Path Env:AWS_ACCESS_KEY_ID -ErrorAction SilentlyContinue | |
| Remove-Item -Path Env:AWS_SECRET_ACCESS_KEY -ErrorAction SilentlyContinue | |
| Remove-Item -Path Env:AWS_SECRET_KEY -ErrorAction SilentlyContinue | |
| Remove-Item -Path Env:AWS_SECURITY_TOKEN -ErrorAction SilentlyContinue | |
| Remove-Item -Path Env:AWS_SESSION_TOKEN -ErrorAction SilentlyContinue | |
| } |
| # https://github.com/pypa/pip/issues/4551 | |
| python -m pip freeze | ForEach-Object{$_.split('==')[0]} | %{python -m pip install --upgrade $_} |
| # from https://stackoverflow.com/a/33548037/7706917 | |
| # | |
| # Explanation: | |
| # --- | |
| # Switch to the main branch | |
| # $> git checkout main | |
| # Prune remote branches | |
| # $> git remote update origin --prune # Prune remote branches | |
| # Get a verbose output of all branches (git reference) | |
| # $> git branch -vv |
| This application is intended for the private use of its developer. Any unauthorized users which connect to this service should have no expectation of privacy or protection of their data. |
| def str_isnullorwhitespace(value: str) -> bool: | |
| """ | |
| Indicates whether a specified string is `null`, empty, or consists only of | |
| white-space characters | |
| Parameters | |
| ----------- | |
| value: str | |
| The string to test. |
| import re | |
| def count_sentences(text: str) -> int: | |
| """ | |
| Count the number of sentences in a given string. | |
| This function is based on the Stack Overflow answer https://stackoverflow.com/a/38589115/7706917 | |
| Inputs | |
| -------- |