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
$PATH_TO_LOGFILE { | |
missingok | |
maxsize 2K | |
rotate 1 | |
dateext | |
dateformat _%Y%m%d | |
compress | |
daily | |
} |
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 | |
# requires jq installed | |
# check if it's a git directory | |
if ! [ -d .git ] | |
then | |
echo "This is not a git directory." | |
exit 1 | |
fi |
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
{ | |
"work": { | |
"name": "Workie", | |
"email": "workie@email.com" | |
}, | |
"personal": { | |
"name": "Funnie", | |
"email": "funnie@email.com" | |
} | |
} |
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
# basic default setup | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
# use nvm if the directory has .nvmrc | |
if [ -f .nvmrc ] | |
then | |
nvm use | |
fi |
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 | |
# this is just to create VS Code workspace settings.json | |
set -e | |
SETTINGS_FILE=".vscode/settings.json" | |
load_user_settings_prompt(){ | |
ORIGINAL_FILE=$1 |
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 | |
alias gpull="git pull" | |
alias gpullr="git pull --rebase" | |
alias gpush="git push" | |
alias gpushf="git push --force-with-lease" | |
alias gcm="git commit -m" | |
alias gca="git commit --amend" | |
alias gs="git status" | |
alias gaa="git add -A" | |
alias ga="git add" |
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 | |
set -e | |
# functions -> | |
prune_prompt(){ | |
echo "Prunable Branches =======" | |
PRUNABLES=`git remote prune origin --dry-run | grep 'origin/.*' | awk '{ print $4 }'` | |
if [ -z "$PRUNABLES" ] |
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
const repo = require('./userRepository'); | |
exports.greet = function() { | |
const user = repo.getUser(); | |
return user.greet(); | |
}; |
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
class User { | |
constructor(name, email) { | |
this.name = name; | |
this.email = email; | |
} | |
greet() { | |
return `Hello, my name is ${this.name}`; | |
} | |
} |
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
function get() { | |
// check the db or something | |
const User = require('./user'); | |
return new User('John', 'johndoe@somemail.com'); | |
} | |
exports.getUser = get; |
NewerOlder