View typedContainer.ts
This file contains 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
// Inspired by https://medium.com/@magnusjt/ioc-container-in-nodejs-e7aea8a89600 | |
class UserModel { | |
isUser(): boolean { | |
return true | |
} | |
} | |
class UserService { | |
constructor(private model: UserModel) {} |
View undelete-s3.sh
This file contains 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 | |
# | |
# Undeletes S3 files in bulk for a provided bucket/prefix/date deleted | |
# | |
# Author: Christopher Carman | |
# Based on https://stackoverflow.com/a/64352685/4175944 | |
set -e | |
Bucket=$1 |
View settings.json
This file contains 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
{ | |
"editor.renderControlCharacters": true, | |
"editor.renderLineHighlight": "all", | |
"files.exclude": { | |
"**/.git": true, | |
"**/.svn": true, | |
"**/.hg": true, | |
"**/.DS_Store": true, | |
"**/*.bundle.js": true, | |
}, |
View .gitconfig
This file contains 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
[alias] | |
fix-head = remote set-head origin --auto | |
[core] | |
excludesfile = ~/.gitignore_global | |
[fetch] | |
prune = true | |
[rebase] | |
autosquash = true | |
View git-clean.zsh
This file contains 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
# Git Helper: Clean merged branches | |
# Checks for merged branches against the currently checkout branch. Lists and confirms for deletion. | |
# To protect branches from ever being deleted, add them to DO_NOT_DELETE. Protected branches will be skipped. | |
# usage: git-clean | |
function git-clean() { | |
local DO_NOT_DELETE=( | |
master | |
develop | |
) | |
local mergedBranches=() |
View qgit.sh
This file contains 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
# Git Helper: Search branch | |
# usage: qbranch keyword | |
# Example: git checkout $(qbranch branch-keyword) | |
# If keyword not | |
function qbranch() { | |
if [ -z "$1" ]; then | |
branches=`git branch` | |
else | |
branches=`git branch | grep $1` | |
fi |
View zsh-helper-docker-exec-snippet.sh
This file contains 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
# Docker Helper: Exec into container using part of container name | |
# usage: docker-exec {keyword} {command} | |
# If keyword not specified, prompts with current containers | |
# If command not specified, prompts with default of bash | |
function docker-exec() { | |
if [ -z "$1" ]; then | |
echo "Select a container: ('q' to cancel)" | |
containers=`docker ps --format '{{.Names}}'` | |
select d in `echo $containers` | |
do |
View zsh-helper-git-quick-checkout-snippet.sh
This file contains 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
# Git Helper: Quickly checkout branch using part of name | |
# usage: qcheckout keyword | |
# If keyword not | |
function qcheckout() { | |
if [ -z "$1" ]; then | |
branches=`git branch` | |
else | |
branches=`git branch | grep $1` | |
fi |