##Sass Functions Cheat Sheet
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 calcDistBetweenPoints(pt1, pt2) { | |
const dx = pt1.x - pt2.x; | |
const dy = pt1.y - pt2.y; | |
// Distance = Pythagorean Theorem to get Hypoteneuse of triangle represented by the two points | |
// doing it with Math.sqrt() is apparently faster than going directly to Math.hypot() 🤷👌 | |
return Math.sqrt((dx * dx) + (dy * dy)); | |
} |
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
/*** Canvas Shape Drawing Functions ***/ | |
// 1. drawStar() - Draw an n-pointed Star w/controls for outer and inner radii - [can make sorta-polygons too] | |
// 2. drawCircle() - Draw a circle (ctx.arc() wrapper) | |
// 3A. drawPoly1() - Draw an n-sided Polygon | |
// 3B. drawPoly2() - Draw an n-sided Polygon | |
// 3C. drawPoly3() - Draw an n-sided Polygon (controls for initial Rotation in Radians) | |
/* Assume the following setup: */ | |
const canvas = document.getElementById('canvas1'); | |
const ctx = canvas.getContext('2d'); |
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
# 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}" == "" ] | |
then | |
STAT=`parse_git_dirty` | |
echo "[${BRANCH}${STAT}]" | |
else | |
echo "" |
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
# 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 com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app" | |
alias hidefiles="defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app" | |
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder" |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"noImplicitAny": true, | |
"target": "es5", | |
"sourceMap": true, | |
"declaration": true, | |
"module": "es2015", | |
"moduleResolution": "node" | |
}, | |
"exclude": [ |
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
/* orig https://gist.github.com/gaearon/ca6e803f5c604d37468b0091d9959269 */ | |
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) |
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
{ | |
"printWidth": 80, | |
"tabWidth": 2, | |
"useTabs": false, | |
"semi": true, | |
"singleQuote": true, | |
"trailingComma": "all" | |
} |
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
build/ | |
node_modules/ | |
package-lock.json | |
yarn.lock | |
package.json | |
*.html |
NewerOlder