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
// &:invalid {} | |
<div> | |
<select required> | |
<option value="" disabled selected> | |
Select items... | |
</option> | |
{options.map(({ value, label }) => ( | |
<option key={value} value={value}> | |
{label} |
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
// yarn add -D stylelint stylelint-config-standard stylelint-order-config-standard stylelint-order | |
// "stylelint": "stylelint \"**/*.(s)css\" --fix", | |
{ | |
"extends": [ | |
"stylelint-config-standard", | |
"stylelint-order-config-standard" | |
], | |
"plugins": [ |
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
var fullname = 'John Doe'; | |
var obj = { | |
fullname: 'Colin Ihrig', | |
prop: { | |
fullname: 'Aurelio De Rosa', | |
getFullname: function () { | |
return this.fullname; | |
}, | |
}, | |
}; |
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
this.value = 'D'; | |
const object = { | |
value: 'A', | |
methodA: () => { | |
console.log(this.value); | |
}, | |
methodB: function () { | |
console.log(this.value); | |
}, |
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
/* | |
PROMISE/THEN approach | |
*/ | |
const userIds = [1, 2, 3]; | |
const requests = userIds.map((userId) => | |
fetch(`https://jsonplaceholder.typicode.com/users/${userId}`), | |
); | |
Promise.all(requests) |
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
var length = 10; | |
function fn() { | |
console.log(this.length); | |
} | |
var obj = { | |
length: 5, | |
method: function (fn) { | |
fn(); | |
arguments[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
// what will be the output to the console? | |
console.log(1); | |
setTimeout(() => { | |
console.log(2); | |
setTimeout(() => console.log(3), 200); | |
}, 200); | |
new Promise(() => console.log(4)); |
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
import axios from 'axios'; | |
import { LANGUAGE_NAME, REFRESH_TOKEN_IN_STORE, TOKEN_NAME_IN_STORE } from '../constants/api'; | |
import { getBrowserLang, setTokens } from './GlobalHelper'; | |
import { logoutDispatch } from './StoreHelper'; | |
import LocalStorageHelper from './LocalStorageHelper'; | |
import { BACKEND_ROUTES } from '../constants/routes'; | |
export const API_REQUEST_AUTH_USER_LOGIN_URL = '/users/login'; | |
export const API_REQUEST_AUTH_USER_LOGIN_SOCIAL_URL = '/login/social'; |
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
<html> | |
<head> | |
<style> | |
body style { | |
display: block; | |
} | |
</style> | |
</head> | |
<body> | |
<style contenteditable> |
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
import React, { Component, createContext } from 'react'; | |
import PropTypes from 'prop-types'; | |
const ExampleContext = createContext({ api: 'lorem ipsum' }); | |
class New extends Component { | |
static contextType = ExampleContext; | |
render() { | |
const { name } = this.props; | |
const { api } = this.context; |
NewerOlder