-
Create a fresh new Next js project. https://nextjs.org/docs/getting-started#automatic-setup
pnpm create next-app --typescript
-
install prettier
- Passwords will contain at least 1 upper case letter
- Passwords will contain at least 1 lower case letter
- Passwords will contain at least 1 number or special character
- There is no length validation (min, max) in this regex!
Regular expression for JavaScript:
/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/
import passport from 'passport'; | |
module.exports = app => { | |
app.get('/findUser', (req, res, next) => { | |
passport.authenticate('jwt', { session: false }, (err, user, info) => { | |
if (err) { | |
console.log(err); | |
} | |
if (info != undefined) { | |
console.log(info.message); |
- Download and install emulator - https://www.visualstudio.com/vs/msft-android-emulator/
- Download commandline tools (see bottom of page) - https://developer.android.com/studio/index.html
- Unzip archive to
C:\Program Files (x86)\Android SDK
- Go to
C:\Program Files (x86)\Android SDK\tools\bin
and run.\sdkmanager.exe "platform-tools"
(it will installadb
required by react native) - Specify SDK path:
Not all random values are created equal - for security-related code, you need a specific kind of random value.
A summary of this article, if you don't want to read the entire thing:
- Don't use
Math.random()
. There are extremely few cases whereMath.random()
is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case. - Don't use
crypto.getRandomBytes
directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable. - If you want to generate random tokens or API keys: Use
uuid
, specifically theuuid.v4()
method. Avoidnode-uuid
- it's not the same package, and doesn't produce reliably secure random values. - If you want to generate random numbers in a range: Use
random-number-csprng
.
You should seriously consider reading the entire article, though - it's
#Download Elementary OS from here: | |
#https://elementary.io/ | |
#Clean-up System | |
sudo apt-get purge midori-granite -y | |
sudo apt-get purge yelp -y | |
sudo apt-get purge evince -y | |
sudo apt-get purge gnome-orca -y | |
sudo apt-get autoremove -y | |
sudo apt-get autoclean -y |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers