$ npx create-next-app app
app/Dockerfile:
FROM node:20.11.1-alpine3.19 as npmWork-in-pogress
Ref: cloudflare/homebrew-cloudflare#21
# Clean up any old version of curl you may have already tried to install
brew remove -f curl
# Download the curl ruby install script provided by cloudflare
| // Modified version of this Stack Overflow response: | |
| // https://stackoverflow.com/a/48459005/1950503 | |
| // (Removes ramda dependency, adds .trim() to string replacer, adds it to Jest global var instead of exporting) | |
| // To use: | |
| // Put `<rootDir>/path/to/customWhitespaceMatcher.js` in your Jest config under setupFiles | |
| // Call it in your tests like this: | |
| // expect( | |
| // customMatchers.whitespaceMatcher(receivedResult, expectedResult).pass | |
| // ).toBeTruthy(); |
| const jsdom = require("jsdom"); | |
| const { JSDOM } = jsdom; | |
| const dom = new JSDOM('<!DOCTYPE html><html><head></head><body></body></html>'); | |
| global.window = dom.window; | |
| global.document = dom.window.document; | |
| // Simulate window resize event | |
| const resizeEvent = document.createEvent('Event'); |
package.json, set version to a prerelease version, e.g. 2.0.0-rc1, 3.1.5-rc4, ...npm pack to create packagenpm publish <package>.tgz --tag next to publish the package under the next tagnpm install --save package@next to install prerelease package| main() { | |
| # Use colors, but only if connected to a terminal, and that terminal | |
| # supports them. | |
| if which tput >/dev/null 2>&1; then | |
| ncolors=$(tput colors) | |
| fi | |
| if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then | |
| RED="$(tput setaf 1)" | |
| GREEN="$(tput setaf 2)" | |
| YELLOW="$(tput setaf 3)" |
| /* | |
| ******************************************************************************** | |
| Golang - Asterisk and Ampersand Cheatsheet | |
| ******************************************************************************** | |
| Also available at: https://play.golang.org/p/lNpnS9j1ma | |
| Allowed: | |
| -------- | |
| p := Person{"Steve", 28} stores the value |
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
| git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n |