This file contains hidden or 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
| function initLoginButton(buttonId, containerId, successUrl) { | |
| var uiConfig = { | |
| signInSuccessUrl: successUrl, | |
| immediateFederatedRedirect: false, | |
| signInOptions: [ | |
| { | |
| provider: firebase.auth.PhoneAuthProvider.PROVIDER_ID, | |
| recaptchaParameters: { | |
| size: 'invisible', // 'invisible' or 'compact' |
This file contains hidden or 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 sleep(time: number) { | |
| return new Promise((resolve) => setTimeout(resolve, time)); | |
| } | |
| async function test1() { | |
| console.log('a1'); | |
| await sleep(100); | |
| console.log('b1'); |
This file contains hidden or 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 sleep(time: number) { | |
| return new Promise((resolve) => setTimeout(resolve, time)); | |
| } | |
| async function test1() { | |
| console.log('a1'); | |
| await sleep(100); | |
| console.log('b1'); |
This file contains hidden or 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 fs = require('fs'); | |
| const path = require('path'); | |
| const data = await db.query(`SELECT * FROM table`); | |
| let result = ''; | |
| for (let row of data) { | |
| result += await processData(row); | |
| } |
This file contains hidden or 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 jwt = require('jsonwebtoken'); | |
| // Пример секретного ключа | |
| // ВАЖНО! Для тестового и продуктового контура ключи будут разные (и отличатся от приведенного) | |
| const JWT_SECRET = 'goKpusp6ThEdURUtRenOwUhAsWUCLheBazluJLPlS8EbreWLdrupIwabRAsiBu' | |
| const data = { | |
| // email авторизованного пользователя | |
| email: 'user-mail@mail.ru', | |
| // Текущее значение timestamp в миллисекуедах |
This file contains hidden or 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
| setTimeout(function timeout() { | |
| console.log('timeout'); | |
| }, 0); | |
| let p = new Promise(function(resolve, reject) { | |
| console.log('create promise'); | |
| resolve(); | |
| }); | |
| p.then(function() { | |
| console.log('resolve promise'); | |
| }); |
This file contains hidden or 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
| export const Timer = (props) => { | |
| const [counter, setCounter] = useState(15); | |
| const text = props.text.toUpperCase(); | |
| const handler = React.useRef<any>(); | |
| useEffect(() => { | |
| handler.current = setInterval(() => { | |
| setCounter((prev) => prev - 1); | |
| }, 1000); |
This file contains hidden or 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
| setTimeout(function timeout() { | |
| console.log('timeout'); | |
| }, 0); | |
| let p = new Promise(function(resolve, reject) { | |
| console.log('create promise'); | |
| resolve(); | |
| }); | |
| console.log('end script'); | |
| p.then(function() { | |
| console.log('resolve promise'); |
This file contains hidden or 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
| class Parent { | |
| constructor(params) { | |
| Object.assign(this, params); | |
| } | |
| static fabric() { | |
| return new Parent({ source: 'fabric', test: 1 }); | |
| } | |
| title() { |
This file contains hidden or 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
| setTimeout(function timeout() { | |
| console.log('timeout'); | |
| }, 0); | |
| let p = new Promise(function(resolve, reject) { | |
| console.log('create promise'); | |
| resolve(); | |
| }); | |
| p.then(function() { | |
| console.log('resolve promise'); | |
| }); |
NewerOlder