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 getToken = body => body.match(/value="(\w+)"/)[1]; | |
export default (registrationFormUrl, submitFormUrl, nickname, callback) => { | |
// BEGIN (write your solution here) | |
const {protocol, hostname, path, pathname, port} = url.parse(submitFormUrl); | |
http.get(registrationFormUrl, res => { | |
const body = []; | |
res.on('data', chunk => { |
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 readFileAsync = file => new Promise((resolve, reject) => { | |
fs.readFile(file, (err, data) => err ? reject(err) : resolve(data)); | |
}); | |
const records = async () => { | |
const readBook = await readFileAsync('phonebook.txt'); | |
const count = readBook.toString().split('\n').length - 1; | |
return `Welcome to The Phonebook\nRecords count: ${count}`; | |
}; |
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 default () => { | |
// BEGIN (write your solution here) | |
const makeActive = (element) => { | |
const link = element.getAttribute('href').substr(1); | |
const currentTab = element.parentNode.parentNode.getElementsByClassName('nav-link active')[0]; | |
const currentLink = currentTab.getAttribute('href').substr(1); | |
const currentDiv = document.getElementById(link); | |
const findDiv = document.getElementById(link); | |
currentDiv.setAttribute('class', 'tab-pane'); | |
findDiv.setAttribute('class', 'tab-pane active'); |
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 moving = (element, emptyCell) => { | |
const oldNode = element.childNodes[0]; | |
element.removeChild(oldNode); | |
element.setAttribute('class', 'p-3 table-active'); | |
emptyCell.setAttribute('class', 'p-3'); | |
emptyCell.append(oldNode); | |
return; | |
}; |
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 data = { | |
name: '', | |
lastName: '', | |
country: '', | |
}; | |
const selectScreen = [screen1, screen2, screen3, screen4]; | |
let screen = 0; |
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 default class BtnGroup extends React.Component { | |
state = { | |
active: null | |
}; | |
onClick = ({ target }) => { | |
const getSide = target.classList[2]; | |
this.setState({ active: getSide }); | |
} |
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 default class Carousel extends React.Component { | |
state = { | |
active: 0 | |
} | |
onClick = (id) => { | |
this.setState({ active: id }); | |
} | |
render() { |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { Text, View, StyleSheet, Dimensions, Alert, TouchableHighlight } from 'react-native'; |
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 mysql = require('mysql'); | |
const Express = require('express'); | |
const connection = mysql.createConnection({ | |
host : 'localhost', | |
user : 'root', | |
password : '123', | |
database : 'node_test' | |
}); |
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
runIntroAnimation = async () => { | |
await this.setState({ | |
timer: this.state.timer + 1.5, | |
scaleA: new Animated.Value(1), | |
opacityA: new Animated.Value(1), | |
scaleB: new Animated.Value(1), | |
opacityB: new Animated.Value(1) | |
}); | |
let { scaleA, scaleB, opacityA, opacityB } = this.state; | |
Animated.stagger(500, [ |