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 aws-codebuild-start() { | |
| # Check if fzf is available | |
| if command -v fzf >/dev/null 2>&1; then | |
| # Use fzf for project selection | |
| local project=$(aws codebuild list-projects --query 'projects[]' --output table | tail -n +4 | head -n -2 | awk '{print $2}' | fzf --prompt="Select CodeBuild project: ") | |
| else | |
| # Fallback to manual selection | |
| local projects=($(aws codebuild list-projects --query 'projects[]' --output text)) | |
| if [[ ${#projects[@]} -eq 0 ]]; then |
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 | |
| set -euo pipefail | |
| # ANSI color codes | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[0;33m' | |
| RED='\033[0;31m' | |
| NC='\033[0m' # no color | |
| ROOT="${HOME}/www" |
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 | |
| set -euo pipefail | |
| # ----------------------- | |
| # Configuration | |
| # ----------------------- | |
| SRC_DIR="${HOME}/www" | |
| DEST_DIR="${HOME}/Desktop/envs" | |
| ZIP_PATH="${HOME}/Desktop/envs.zip" |
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 | |
| # ----------------------------------------------------------------------------- | |
| # setup_dev_env_mac.sh | |
| # ----------------------------------------------------------------------------- | |
| # Automated bootstrap script for a fresh Apple‑Silicon MacBook (M1–M4) | |
| # Installs and configures: | |
| # • Xcode Command‑Line Tools (prerequisite) | |
| # • Homebrew | |
| # • Docker Desktop | |
| # • fnm (Fast Node Manager) + latest LTS Node.js |
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 will receive a word or phrase as a parameter and return the same string but with all the letter "E"s replaced by the number 3 | |
| function generateCoolPwd (str) { | |
| console.log(str.replaceAll('e', 3).replaceAll('E', 3)) | |
| } |
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
| const listHeavyPackages = packages => packages.split(`\n`).forEach(packageRow => { | |
| if (packageRow === ``) return | |
| const [s, p] = packageRow.split(`\t`) | |
| const size = s.trim() | |
| const package = p.trim() | |
| if (size.includes('M')) console.log(`${package} might be a heavy package: ${size}`) | |
| }) |
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 middy from '@middy/core' | |
| import { Logger } from '@aws-lambda-powertools/logger' | |
| import { debug } from './core' | |
| const logger = new Logger({ | |
| logLevel: 'INFO', | |
| serviceName: process.env.PROJECT_NAME | |
| }) | |
| const base = (handler: any) => middy(handler) |
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 { SSMClient, GetParameterCommand } from '@aws-sdk/client-ssm' | |
| const secretParameterNameBuilder = (name: string): string => `/env/${process.env.PROJECT_NAME}/${process.env.STAGE}/${name}` | |
| export const getParameter = async (name: string): Promise<string> => { | |
| const client = new SSMClient({}) | |
| const param = secretParameterNameBuilder(name) | |
| const { Parameter: { Value } } = await client.send(new GetParameterCommand({ |
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
| const getFlagEmoji = countryCode => { | |
| const codePoints = countryCode | |
| .toUpperCase() | |
| .split('') | |
| .map(char => 127397 + char.charCodeAt()); | |
| return String.fromCodePoint(...codePoints); | |
| } |