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
| npx create-next-app@latest [name] --empty --ts --no-tailwind --src-dir --no-linter --no-react | |
| -compiler --app --turbopack --import-alias "@/*" |
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
| # https://www.leereamsnyder.com/favicons-in-2021#clearing-the-icon-cache-in-macos-safari-is-deeply-unpleasant | |
| rm -rf ~/Library/Safari/Favicon Cache/**/* | |
| rm -rf ~/Library/Safari/Touch Icons Cache/**/* | |
| rm -rf ~/Library/Safari/Template Icons/**/* |
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
| sudo find -E . -type f \ | |
| -name "*docker*" \ | |
| -not -regex ".*node_modules.*" \ | |
| -not -regex ".*\/\.[^/]+\/.*" \ | |
| -not -regex ".*\/Library\/.*" \ | |
| -not -regex ".*\/Applications\/.*" \ | |
| -not -regex ".*\/wp-content\/plugins\/.*" \ | |
| 2> /dev/null |
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
| async function getResponseTime() { | |
| const start = performance.now() | |
| await fetch('YOUR_URL_HERE') | |
| return performance.now()-start | |
| } | |
| async function main() { | |
| const times = [] | |
| for (let i = 0; i < 100; i++) { | |
| console.clear() |
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
| !^ first argument | |
| !$ last argument | |
| !* all arguments | |
| !:2 second argument | |
| !:2-3 second to third arguments | |
| !:2-$ second to last arguments | |
| !:2* second to last arguments | |
| !:2- second to next to last arguments |
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
| { | |
| "printWidth": 110, | |
| "singleQuote": true, | |
| "useTabs": false, | |
| "tabWidth": 2, | |
| "semi": true, | |
| "trailingComma": "all", | |
| "arrowParens": "always", | |
| "bracketSpacing": true, | |
| "pugTabWidth": 2, |
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
| services: | |
| mysql: | |
| image: mysql | |
| restart: always | |
| command: --default-authentication-plugin=mysql_native_password | |
| volumes: | |
| - ./db:/var/lib/mysql | |
| environment: | |
| MYSQL_ROOT_PASSWORD: root | |
| ports: |
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 getSteps(currentRail, numberRails) { | |
| let step1 = (currentRail === numberRails) || (currentRail === 1) ? ((numberRails - 1) * 2) : ((numberRails - currentRail) * 2); | |
| let step2 = (currentRail === numberRails) || (currentRail === 1) ? (step1) : ((currentRail - 1) * 2); | |
| return [step1, step2] | |
| } | |
| function encodeRailFenceCipher(string, numberRails) { | |
| let res = '' | |
| for (let currentRail = 1; currentRail <= numberRails; currentRail++) { |
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 maxSumOfTwoRangesIn(arr) { | |
| const ranges = [[]]; | |
| for (let i = 0; i < arr.length; i++) { | |
| const last = ranges.length - 1; | |
| for (let j = 0; j <= last; j++) { | |
| // ranges.push(ranges[j].concat(i)) | |
| ranges.push([...ranges[j], i]); | |
| } | |
| } |
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
| #!/bin/bash | |
| if [[ -z $TNF_API_KEY ]] | |
| then | |
| echo 'Error: TNF_API_KEY variable not found, please get api key from https://tinypng.com/developers and paste it in your ~/.zshrc or ~/.bashrc' | |
| exit 1 | |
| fi | |
| for file in $(git status -s | grep -E '^[^D]{2}' | cut -c4- | grep -E "(.png|.jpg|.webp|.jpeg)") | |
| do |
NewerOlder