This file contains 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
import { useCallback, useEffect, useMemo, useState } from 'react' | |
function Info({ blue, red }: any) { | |
useMemo(() => getBlue(blue), [blue]) | |
useMemo(() => getRed(red), [red]) | |
// getBlue(blue) | |
// getRed(red) | |
return ( | |
<div> | |
<p>blue {blue}</p> |
This file contains 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
const jsonIgnore = require('json-ignore'); | |
const objectToProcess = { | |
field1: 'field1', | |
field2: 'field2', | |
fieldToRemove: 'hihi' | |
} | |
const result = jsonIgnore(['fieldToRemove'], objectToProcess); |
This file contains 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
app.get('/auth/example', | |
passport.authenticate('oauth2')); | |
app.get('/auth/example/callback', | |
passport.authenticate('oauth2', { failureRedirect: '/login' }), | |
function(req, res) { | |
// Successful authentication, redirect home. | |
res.redirect('/'); | |
}); |
This file contains 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
passport.use(new OAuth2Strategy({ | |
authorizationURL: 'https://www.example.com/oauth2/authorize', | |
tokenURL: 'https://www.example.com/oauth2/token', | |
clientID: EXAMPLE_CLIENT_ID, | |
clientSecret: EXAMPLE_CLIENT_SECRET, | |
callbackURL: "http://localhost:3000/auth/example/callback" | |
}, | |
function(accessToken, refreshToken, profile, cb) { | |
User.findOrCreate({ exampleId: profile.id }, function (err, user) { | |
return cb(err, user); |
This file contains 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
passport.use(new OAuth2Strategy({ | |
authorizationURL: 'https://www.example.com/oauth2/authorize', | |
tokenURL: 'https://www.example.com/oauth2/token', | |
clientID: EXAMPLE_CLIENT_ID, | |
clientSecret: EXAMPLE_CLIENT_SECRET, | |
callbackURL: "http://localhost:3000/auth/example/callback" | |
}, | |
function(accessToken, refreshToken, profile, cb) { | |
User.findOrCreate({ exampleId: profile.id }, function (err, user) { | |
return cb(err, user); |
This file contains 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
version: '3' | |
services: | |
config: | |
build: | |
context: . | |
ports: | |
- "8000:8000" | |
command: | |
"python manage.py runserver 0.0.0.0:8000" |
This file contains 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
for await (const value of arr) { | |
await mongoDataDao.insertOne({ value: value }, 'temp', 'number', mongoClient); | |
} |
This file contains 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 bootstrap() { | |
const app = await NestFactory.create(ApplicationModule); | |
app.useGlobalPipes(new ValidationPipe()); | |
await app.listen(3000); | |
} | |
bootstrap(); |
This file contains 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 bootstrap() { | |
const app = await NestFactory.create(ApplicationModule); | |
app.useGlobalPipes(new ValidationPipe()); | |
await app.listen(3000); | |
} | |
bootstrap(); |
This file contains 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 bootstrap() { | |
const app = await NestFactory.create(ApplicationModule); | |
app.useGlobalPipes(new ValidationPipe()); | |
await app.listen(3000); | |
} | |
bootstrap(); |
NewerOlder