Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
git fetch --all -p; git branch -vv | grep ": gone]" | awk '{ print $1 }' | xargs -r -n 1 git branch -D |
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
'use strict'; | |
const functions = require('firebase-functions'); | |
const fastify = require('./fastify'); | |
exports.greetFromFastify = functions.https.onRequest(fastify); |
List of useful npx (NPM Package Runner) commands.
Using NPX we can execute/run node binaries without the need to install it locally or globally.
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
import foo from 'foo'
instead of const foo = require('foo')
to import the package. You also need to put "type": "module"
in your package.json and more. Follow the below guide.await import(…)
from CommonJS instead of require(…)
.{ | |
"recommendations": [ | |
"dbaeumer.vscode-eslint", | |
"esbenp.prettier-vscode", | |
"streetsidesoftware.code-spell-checker", | |
"GitHub.vscode-pull-request-github", | |
"ms-playwright.playwright", | |
"pflannery.vscode-versionlens", | |
"ZixuanChen.vitest-explorer" | |
] |
import { useSyncExternalStore } from "react"; | |
// For more on the useSyncExternalStore hook, see https://react.dev/reference/react/useSyncExternalStore | |
// The code is almost identical to the source code of zustand, without types and some features stripped out. | |
// Check the links to see the references in the source code. | |
// The links are referencing the v5 of the library. If you plan on reading the source code yourself v5 is the best way to start. | |
// The current v4 version contains lot of deprecated code and extra stuff that makes it hard to reason about if you're new to this. | |
// https://github.com/pmndrs/zustand/blob/fe47d3e6c6671dbfb9856fda52cb5a3a855d97a6/src/vanilla.ts#L57-L94 | |
function createStore(createState) { |