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
| Suffolk Area has [group_count service_body="1001" root_server="https://bmlt.newyorkna.org/main_server"] groups with [meeting_count] meetings in [list_locations root_server="https://bmlt.newyorkna.org/main_server" services="1001" state="0"] | |
| [bmlt_tabs service_body="1001" root_server="https://bmlt.newyorkna.org/main_server"] |
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
| # terraform info | |
| local tf_info='$(tf_workspace)' | |
| function tf_workspace { | |
| if [ -f ".terraform/environment" ]; then | |
| local workspace=$(cat .terraform/environment); | |
| echo -n "%{$fg_bold[green]%}tf:%{$fg[cyan]%}${workspace}%{$fg_bold[green]%}%{$reset_color%}" | |
| else | |
| echo -n "" | |
| 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
| export GPG_TTY=$(tty) | |
| alias ll='ls -al' | |
| alias h='history' | |
| alias hg='history | grep $1' | |
| alias c='clear' | |
| alias ns='arp -a | grep :' | |
| alias gs='git status' | |
| alias tf='terraform fmt -recursive' | |
| alias account='{ aws sts get-caller-identity & aws iam list-account-aliases; } | jq -s ".|add"' |
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
| { | |
| "Antarctica": { | |
| "long_name": "Antarctica", | |
| "short_name": "Antarctica" | |
| }, | |
| "AU": { | |
| "long_name": "Australia", | |
| "short_name": "AU" | |
| }, | |
| "BR": { |
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
| #!/usr/bin/env bash | |
| usage () { | |
| echo "Usage: kx [OPERATION]" | |
| echo " -h Help. Displays this message." | |
| echo " -l list contexts" | |
| echo " -c get current context" | |
| echo " -s set context" | |
| echo " -d delete context" | |
| } |
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
| <?php | |
| function getLangInfo() | |
| { | |
| $langs = ['da', 'de', 'en', 'es', 'fa', 'fr', 'it', 'pl', 'pt', 'ru', 'sv']; | |
| $ret = []; | |
| foreach ($langs as $lang) { | |
| $daysOfWeek = []; | |
| $lang_name = \Locale::getDisplayLanguage($lang, $lang); |
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
| <?php | |
| private function httpGet(string $url): string | |
| { | |
| if (defined('WP_CONTENT_DIR')) { | |
| return $this->wordpressGet($url); | |
| } else { | |
| return $this->guzzleGet($url); | |
| } | |
| } |
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 yaml | |
| import re | |
| from kubernetes import client, config | |
| def parse_name(name): | |
| if len(name.split("/")) > 1: | |
| registry = name.split("/")[0] | |
| if not ( | |
| re.search("\.", registry) or re.search("localhost:[0-9]+", registry) |
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
| #!/usr/bin/env bash | |
| normalize_image_name() { | |
| local name="$1" | |
| local registry | |
| if [[ "$name" == *\/* ]]; then | |
| registry=${name%%/*} | |
| if ! [[ "$registry" == *.* || "$registry" == localhost:[0-9]* ]]; then | |
| name="docker.io/${name}" | |
| 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
| #!/usr/bin/env bash | |
| # Fetches AWS credentials from a EC2 IAM role and configures them locally for multiple profiles. | |
| # Script expects input parameter to be a named Host in your SSH config, then sets AWS creds name using that Host name. | |
| # | |
| # Configuration | |
| # Check for SSH_CONFIG_FILE env var then default to users home dir | |
| SSH_CONFIG_FILE="${SSH_CONFIG_FILE:-$HOME/.ssh/config}" | |
| readarray -t ssh_hosts < <(grep 'Host ' "$SSH_CONFIG_FILE" | awk '{print $2}' | sort -u) | |
| # ANSI color codes for pretty output |