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
| find /home/example -iname "*.txt" -exec grep -Li "mystring" {} \+ |
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
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "chrome", | |
| "request": "launch", | |
| "name": "Next: Chrome", | |
| "url": "http://localhost:3000", | |
| "webRoot": "${workspaceFolder}" | |
| }, |
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
| /** | |
| * This is a better alternative to using 'forwards' | |
| * fill mode, as it allows you to update inline styles | |
| * after the animation has completed. Contrast with: | |
| * | |
| * element.animate({ | |
| * { opacity: '0.2' }, | |
| * { | |
| * duration: 500, | |
| * easing: 'ease-in-out', |
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
| /* | |
| * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). | |
| * This devtool is neither made for production nor for readable output files. | |
| * It uses "eval()" calls to create a separate source file in the browser devtools. | |
| * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) | |
| * or disable the default devtool with "devtool: false". | |
| * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). | |
| */ | |
| /******/ (() => { // webpackBootstrap | |
| /******/ "use strict"; |
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
| rollup -c ; cat my-element.bundled.js | gzip -9 | wc -c ; rm my-element.bundled.js |
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
| // tzName is one of the tz database names at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | |
| // Example: 'Pacific/Honolulu' (UTC-10) | |
| function getUTCOffset(tzName, date) { | |
| date = new Date(date || Date.now()); | |
| date.setMilliseconds(0); | |
| // 1) Get the local UTC offset | |
| // --------------------------- | |
| // Convert date UTC offset to true hours offset. | |
| // Date.prototype.getTimezoneOffset() confusingly returns positive |
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 isDstObserved(date = new Date()) { | |
| var jan = new Date(0, 1); | |
| var jul = new Date(6, 1); | |
| const stdTimezoneOffset = Math.max( | |
| jan.getTimezoneOffset(), | |
| jul.getTimezoneOffset() | |
| ); | |
| return date.getTimezoneOffset() < stdTimezoneOffset; | |
| } |
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
| append_line() { | |
| set -e | |
| local update line file pat lno | |
| update="$1" | |
| line="$2" | |
| file="$3" | |
| pat="${4:-}" | |
| lno="" | |
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
| confirm() { | |
| while true; do | |
| read -p "$1 ([y]/n) " -r | |
| REPLY=${REPLY:-"y"} | |
| if [[ $REPLY =~ ^[Yy]$ ]]; then | |
| return 1 | |
| elif [[ $REPLY =~ ^[Nn]$ ]]; then | |
| return 0 | |
| fi | |
| done |
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
| new Date(seconds * 1000).toISOString().substr(11, 8) |