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
| events {} | |
| http { | |
| server { | |
| listen 80; | |
| location / { | |
| proxy_pass https://dan-jemini.app.n8n.cloud/webhook/dc3ee59d-b944-4e98-84a3-62ec583d63be/chat; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; |
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
| # This is a Python file XD | |
| import sys | |
| import string | |
| import base64 | |
| # Globals | |
| def getAlphaToNumbersDict(): | |
| alpha_to_numbers = {} | |
| for index, char in enumerate(string.ascii_lowercase, 1): | |
| alpha_to_numbers[char] = index % 10 |
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
| // Logger.ts | |
| export const LogLevel = { | |
| INFO: 30, | |
| DEBUG: 20, | |
| }; | |
| export class Logger { | |
| // default log level | |
| level = LogLevel.INFO; |
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
| class UserModel { | |
| async getUsername() { | |
| return "Mullen"; | |
| } | |
| } | |
| it("#getUsername() should get the username", async () => { | |
| const user = new UserModel(); | |
| const username = user.getUsername(); | |
| expect(username).toBeDefined(); | |
| }); |
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
| it("#getUsername() should get the username", () => { | |
| // TBD | |
| }) |
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
| function humanReadable(seconds) { | |
| let hours = getHours(seconds) | |
| let mins = getMins(seconds - (hours * 60 * 60)) | |
| let sec = seconds - (mins * 60) - (hours * 60 * 60) | |
| return [hours, mins, sec].map(padZerosToTensPlace).join(':') | |
| } | |
| function getHours(seconds) { | |
| return Math.floor((seconds / (60 * 60))) | |
| } |
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
| function humanReadable(seconds) { | |
| var pad = function(x) { return (x < 10) ? "0"+x : x; } | |
| return pad(parseInt(seconds / (60*60))) + ":" + | |
| pad(parseInt(seconds / 60 % 60)) + ":" + | |
| pad(seconds % 60) | |
| } |
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
| AZ_ENV_FILE=$HOME/.my-env/umbrella-corp-env-az | |
| touch $AZ_ENV_FILE | |
| source <(cat $AZ_ENV_FILE) | |
| env-az() { | |
| # | |
| # ... all read-from-user code that we previously wrote | |
| # | |
| # Can run this before calling the env-az-setup command |
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
| env-az() { | |
| # Display the current entry | |
| echo -n "az subscription env ($AZ_SUB_ENV): " | |
| # Read the user input into a new local var | |
| read az_sub_env; | |
| # If the user input was NOT empty then.. | |
| if [ ! -z "$az_sub_env" ]; then; | |
| # Save the value as the new env var | |
| export AZ_SUB_ENV=$az_sub_env; |
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
| # AZ_SUB_ENV => the azure subscription env suffix | |
| # AZ_AKS_ENV => the azure kubernetes service env suffix | |
| env-az-setup() { | |
| echo "Setting Subscription: $AZ_SUB_ENV" | |
| az account set --subscription umbrellaCorp-crankshaft-$AZ_SUB_ENV; | |
| echo "Getting Kubectl Creds: dev" | |
| az aks get-credentials --resource-group crankshaft-aks-$AZ_AKS_ENV-rg --name crankshaft-aks-$AZ_AKS_ENV; | |
| helm list; | |
| } |
NewerOlder