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
| # ------------------------------------------------------ | |
| # Load proper nvm version if a nvmrc is given on WINDOWS | |
| # ------------------------------------------------------ | |
| load-nvmrc() { | |
| if [[ -f .nvmrc && -r .nvmrc ]]; then | |
| declare version; | |
| version="$(< .nvmrc)"; | |
| if [ -z "$(node -v | grep $version)" ]; then | |
| if [ -z "$(nvm list | grep $version)" ]; then | |
| echo "Node $version is not currently installed through nvm. Installing."; |
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
| \documentclass[11pt, oneside]{article} | |
| \usepackage[margin=0.5in]{geometry} | |
| \geometry{letterpaper} | |
| \usepackage[parfill]{parskip} | |
| \usepackage{graphicx} | |
| \usepackage{amssymb} | |
| \usepackage{xcolor} | |
| \pagecolor{white} | |
| \usepackage[colorlinks = true, linkcolor = blue, urlcolor = blue]{hyperref} | |
| \pagestyle{empty} |
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
| import Vue from 'vue' | |
| // the list of vue components to install | |
| import components from './vueComponents' | |
| class SlVueWrapper { | |
| constructor($timeout) { | |
| this.name = 'vue'; | |
| this.restrict = 'A'; | |
| this.terminal = true; |
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
| /** | |
| * Inspired by @MoOx original script: https://gist.github.com/MoOx/93c2853fee760f42d97f | |
| * Adds file download per @micalevisk https://gist.github.com/MoOx/93c2853fee760f42d97f#gistcomment-2660220 | |
| * | |
| * Changes include: | |
| * - Get the description from the `title` attribute instead of `aria-label` (doesn't exist anymore) | |
| * - Use style.backgroundColor and parse the rgb(...) to hex (rather than regex parsing of 'style' string) | |
| * - Downloads labels to a JSON file named after the webpage to know which GitHub repo they came from. | |
| * | |
| * Last tested 2019-July-27: |
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
Show hidden characters
| { | |
| "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe", | |
| "window.restoreWindows": "all", | |
| "window.newWindowDimensions": "inherit", | |
| // Inconsolata: https://levien.com/type/myfonts/inconsolata.html | |
| "editor.fontFamily": "Inconsolata, Consolas, 'Courier New', monospace", | |
| "editor.fontSize": 16, // 15 without Inconsolata | |
| "editor.lineHeight": 21, // recommended to reset to default without Inconsolata |
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
| const getCryptoRandomValue = () => crypto.getRandomValues(new Uint32Array(1))[0]/Math.pow(2, 32); | |
| const getRandomArrayItem = a => a[getCryptoRandomValue()*a.length|0]; | |
| const array = [1,2,3,4,5]; | |
| console.log(getRandomArrayItem(array)); |
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
| var enums = {}; | |
| enums.keyboard = { | |
| BACKSPACE: 8, | |
| TAB: 9, | |
| ENTER: 13, | |
| SHIFT: 16, | |
| CTRL: 17, | |
| ALT: 18, | |
| PAUSE: 19, | |
| CAPS_LOCK: 20, |
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
| const pipe = (fn,...fns) => (...args) => !fns.length ? fn(...args) : pipe(...fns)(fn(...args)); | |
| // example: pipe(function1, function2) |
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 isElementOverlapping(elem1, elem2) { | |
| var rect1 = elem1.getBoundingClientRect(); | |
| var rect2 = elem2.getBoundingClientRect(); | |
| return !( | |
| rect1.right < rect2.left || | |
| rect1.left > rect2.right || | |
| rect1.bottom < rect2.top || | |
| rect1.top > rect2.bottom | |
| ); | |
| }; |