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
export default (fullName: string) => ( | |
fullName.split(' ').map((item, index) => { | |
return index === 1 ? `@${item}` : item; | |
}) | |
) |
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
1) npm i jest --save-dev | |
2) npm i @types/jest ts-jest —save-dev | |
3) create jest.config.js | |
--------------------------- | |
module.exports = { | |
"roots": [ | |
"<rootDir>/src" | |
], | |
"transform": { | |
"^.+\\.tsx?$": "ts-jest" |
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
it('should redirect to another page', () => { | |
const user = { | |
id: 1, | |
token: 'J9gj9fj90.Tgf84h8Ufds.jfiosdjfi', | |
}; | |
// static method | |
const spy = jest.spyOn(Login, 'redirectUser'); | |
mount(<Login user={user} />, global.contextData); | |
expect(spy).toBeCalled(); |
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
create own config - https://createapp.dev/parcel |
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
//Link to repository - https://github.com/google-map-react/google-map-react | |
import React, { Component } from 'react'; | |
import GoogleMapReact from 'google-map-react'; | |
import Marker from './marker'; | |
import mapStyle from './map-style'; | |
export default class MapContainer extends Component { | |
renderMarkers() { | |
const { markersCoords } = this.props; |
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
getUsers() { | |
const { users } = this.props; | |
if (Array.isArray(users)) { | |
return users.map((user) => { | |
return (<Participant key={user.id} userData={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
How to delete a commit on Github | |
1. We get the hash code of the commit that we want to return to. | |
2. Go to the repository folder and write to the console: | |
$ git reset --hard a3775a5485af0af20375cedf46112db5f813322a | |
$ git push --force |
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
var a,w=document.createTreeWalker(document,NodeFilter.SHOW_TEXT);while(a=w.nextNode()){if(a.textContent.trim().length)a.textContent='Одиннадцатиклассница пошла посмотреть на достопримечательность, она шла долго, несколько строчек, пока не пришла'} |
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 React, { Component } from 'react'; | |
import ApiService from '../../services/api-service'; | |
import Nav from '../../components/nav'; | |
import Metabox from '../../components/metabox'; | |
import Dialog from '../../components/dialog'; | |
import Page404 from '../../components/page-404'; | |
import Spinner from '../../components/spinner'; | |
import './single-sample.scss'; | |
import placeholder from './placeholder-image.png'; | |
import { AppStatusContext } from '../../context/app-status-context'; |
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
https://slides.com/wladeveloper/flex-content#/ |
NewerOlder