// ./main.js
require('./example-module').whoami();
// ./example-module.js
module.exports.whoami = () => console.log(`Hello, I'm a file`);
// Output: ./example-module.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
#! bin/sh | |
# Docker Helpers | |
# List all containers by ID | |
docker ps -aq | |
# Stops all docker containers | |
docker stop $(docker ps -aq) | |
# Remove all containers |
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
# Command to call git status -s on all repositories in a directory | |
find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} && cd {} && git status | sed "s/[(][^)]*[)]//" | sed '/^[[:space:]]*$/d' && echo)' \; | |
# Command to delete local branches that have been merged, except special branches | |
git branch --merged | egrep -v "(^\*|master|production|other-special-branch)" | xargs git branch -d | |
# Command to pull a pull request locally | |
git pull origin pull/[PR_ID]/head | |
# Commands to delete all tags local and remote |
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 speak(phrase = 'Hello World!') { | |
console.log(phrase); | |
} | |
speak(); | |
// Output: Hello World! | |
speak(undefined); | |
// Output: Hello World! |
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="Usage: $(basename "$0") region stack-name [aws-cli-opts] | |
where: | |
region - the AWS region | |
stack-name - the stack name | |
aws-cli-opts - extra options passed directly to create-stack/update-stack | |
" |
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
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
People
![]() :bowtie: |
π :smile: |
π :laughing: |
---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
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
#!/bin/bash | |
# | |
# Script to strip all whitespace characters from a string | |
input_string=$1 | |
trimmed_input_string="$(echo -e "${input_string}" | tr -d '[:space:]')" | |
echo "|${trimmed_input_string}|" |
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
#!/bin/bash | |
# | |
# Script to split a string based on the delimiter | |
input_string=$1 | |
IFS=$2 read -ra string_split <<< "$input_string" | |
#Print the split string | |
for i in "${string_split[@]}" | |
do |
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
#!/bin/bash | |
# | |
# Script to demonstrate capturing the exit status of a sub shell command while assigning the output to a local variable | |
test() { | |
local inline_declaration_and_definition=$(exit 3) | |
echo $? # output: 0 | |
local separate_declaration_and_definition | |
separate_declaration_and_definition=$(exit 3) | |
echo $? # output: 3 |
OlderNewer