Skip to content

Instantly share code, notes, and snippets.

Rich Werden r-i-c-h

View GitHub Profile
r-i-c-h / .bash_profile-Colorful-Git-Status-Prompt
Created Jun 22, 2020
My Colorful git-Status-aware prompt setup in my .bash_profile
View .bash_profile-Colorful-Git-Status-Prompt
# CRAZY COLORED NEW PROMPT w/repo Branch and Status:
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
echo "[${BRANCH}${STAT}]"
echo ""
r-i-c-h / .bash_profile-stuff-1
Created Jun 22, 2020
Some of the aliases from my .bash_profile
View .bash_profile-stuff-1
# My Aliases
alias ..="cd .."
alias rmrf="rm -rf"
# ls on steroids:
alias see="ls -laShF | more"
# Some Apple MacOS specifics for showing/hiding hidden files in the Finder
alias showfiles="defaults write AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/"
alias hidefiles="defaults write AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/"
alias showdesktop="defaults write CreateDesktop -bool true && killall Finder"
r-i-c-h / tsconfig.json
Created Jan 30, 2020
Rich's tsconfig.json
View tsconfig.json
"compilerOptions": {
"noImplicitAny": true,
"target": "es5",
"sourceMap": true,
"declaration": true,
"module": "es2015",
"moduleResolution": "node"
"exclude": [
r-i-c-h / webpack.config.js
Last active Jan 24, 2020
Webpack Code Splitting
View webpack.config.js
/* orig */
module.exports = {
entry: {
main: './src/app.js',
output: {
// `filename` provides a template for naming your bundles (remember to use `[name]`)
filename: '[name].bundle.js',
// `chunkFilename` provides a template for naming code-split bundles (optional)
r-i-c-h / .prettierrc
Created Jan 24, 2020
Rich's .prettierrc
View .prettierrc
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
r-i-c-h / .prettierignore
Created Jan 24, 2020
Rich's .prettierignore file
View .prettierignore
r-i-c-h /
Last active Jan 17, 2020
How to Update Node.js

To Update Node

Latest "Long Term Support" Ver

nvm install lts/*

Latest "Stable" Version

nvm install stable

Update + Reinstall your GLOBAL packages:

r-i-c-h / my.gitignore
Last active Jul 14, 2020
Rich's .gitignore File
View my.gitignore
# Rich's .gitignore file:
# See
# leading-slash stops recursion, trailing slash = directory/
# 1) Notes files... <<<<
# 2) Dependency directories
View JS-SubsetSum.js
// Will actually work without the 'String()` whatnot, but I'm being particular
const subsetSum = (arr, target) => {
let dictObj = {};
for (let i = 0; i < arr.length; i++) {
const val = arr[i];
const compliment = String(target - val);
if (dictObj.hasOwnProperty(compliment)) { // must use hasOwnProp in case of index=0 which would return as false!!
return [dictObj[compliment],i];
You can’t perform that action at this time.