Key point: Do not cache session tokens. Fetch a fresh token right before each API call, and when you update the user externally, reload the User
and refresh the token.
References: Force a session token refresh · clerk_flutter
repo
Key point: Do not cache session tokens. Fetch a fresh token right before each API call, and when you update the user externally, reload the User
and refresh the token.
References: Force a session token refresh · clerk_flutter
repo
Planes, rockets, cars, ships, clothes, medical devices — all physical goods that require industrial-scale production.
Even your smartphone (the symbol of miniaturization) requires giant semiconductor fabs that cost $20–$30 billion each. That's not garage tinkering — it's industrial might.
"You can't 3D-print a Boeing 787 in your basement." Industrial capacity still matters.
// first | |
const moveZeros = (nums) => { | |
// const nums = [0,1,0,3,12] | |
return nums; | |
}; | |
// second - done | |
const intersectionOfTwoArrays = (nums1, nums2) => { | |
const set1 = new Set(nums1); | |
const set2 = new Set(nums2); |
<link rel="shortcut icon" width=32px> | |
<canvas style="display: none" id="loader" width="16" height="16"></canvas> | |
<script> | |
class Loader { | |
constructor(link, canvas) { | |
this.link = link; | |
this.canvas = canvas; | |
this.context = canvas.getContext('2d'); | |
this.context.lineWidth = 2; |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
const express = require('express'); | |
const app = express(); | |
// Application | |
app.get('/', function(req, res) { | |
if (process.env.NODE_ENV === 'development') { | |
for (var key in require.cache) { | |
delete require.cache[key]; | |
} | |
} |
In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.
Here's one way to set it up:
npm init -y
in your project folder (don't skip this step!)npm install terser
Now, to minify a file called like_button.js
, run in the terminal:
import React, { useEffect } from 'react' | |
import L from 'leaflet' | |
import { GestureHandling } from 'leaflet-gesture-handling' | |
import 'leaflet/dist/leaflet.css' | |
import 'leaflet-gesture-handling/dist/leaflet-gesture-handling.css' | |
const Map = props => { | |
let { lat, lng } = props | |
useEffect( |
// using snackbar with Redux | |
// create a feature component for Notification | |
// notification - action + container + reducer | |
// the action is exported | |
// so this can be dispatched from anywhere | |
// the container will be mounted inside the root component | |
// the root component will be wrapped with SnackbarProvider from notistack |