React:
- What can you say about the high order component(HOC)? - https://reactjs.org/docs/higher-order-components.html
- What is the difference between React.PureComponent and React.Component? - https://stackoverflow.com/questions/41340697/react-component-vs-react-purecomponent/43936258
- Why we shouldn't use inline arrow functions in component props? Using arrow functions or binding in react component is a bad practice that hurts performance, because the function is recreated on each render. Whenever a function is created, the previous function is garbage collected. Rerendering many elements might create jank in animations. Using an inline arrow function will cause PureComponents, and components that use shallowCompare in the shouldComponentUpdate method to rerender anyway. Since the arrow function prop is recreated each time, the shallow compare will identify it as a change to a prop, and the component will rerender.
- What methods of lifecycle do you know? Call them in the correct order. -
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
{ | |
"us-east-1": "A1,CO,A2,AG,AI,AN,AW,BB,BM,BS,BZ,CR,CU,DM,DO,GD,GP,GT,HN,HT,JM,KN,KY,LC,MQ,MS,NI,O1,PA,PM,PR,SV,TC,TT,US,VC,VG,VI", | |
"us-east-2": "CA", | |
"us-west-1": "MX,PF,PN", | |
"ap-northeast-1": "FM,GU,JP,MH,MP,PW,UM", | |
"ap-northeast-2": "KP,KR,TW", | |
"ap-southeast-1": "*", | |
"ap-south-1": "AF,BD,BH,BI,BT,CD,DJ,ER,ET,IN,IO,IQ,IR,KE,KG,KM,KW,LK,MG,MU,MV,MW,MZ,NP,OM,PK,QA,RE,RW,SA,SC,SO,TJ,TM,TZ,UG,UZ,YE,YT", | |
"ap-southeast-2": "AQ,AS,AU,CK,FJ,HM,KI,NC,NF,NR,NU,NZ,PG,SB,TK,TO,TV,VU,WF,WS", | |
"sa-east-1": "AR,BO,BR,BV,CL,EC,FK,GF,GS,GY,PE,PY,SH,SR,UY,VE", |
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: '2' | |
services: | |
php: | |
image: shcoder/alpine-php7-fpm-composer | |
volumes_from: | |
- app | |
environment: | |
- SERVICE_NAME=app_name | |
nginx: |
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
Всем привет. | |
Я сижу на линуксе около трёх лет, начинал с убуту и около года сидел на ней. Она жутко гнала(вероятно из-за меня же), но работало. Много раз я соглашался с менеджером пакетов удалить libc из-за этого просто переставлял убунту. Бывали случаи когда правя Grub я его ломал и снова накатывал убунтушку. Потом мой взор пал на аскетичный CrunchBang. Он очень простой и стабильный в плане софта. Рабочий стол вообще чистый, честно говоря это первое, что меня в нём привлекло. С ним я уже около двух лет и он стоит на каждой моей машине. | |
От винды я отказался полностью, года два назад, полностью живу с этим и радуюсь. Иногда аптайм моих компов достигает 2-3 месяцев пока не выключат свет. | |
Ниже я расскажу о своём наборе утилиток: | |
✔ CrunchBang distribution based Debian 7 Wheezy | |
✔ SublimeText3 | |
✔ Guake Terminal | |
✔ ZSH SHELL |
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
loop: for(var i = 0; i<=10; i++){ | |
continue loop; | |
} |
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 = "global" | |
function who(){ | |
console.log(a) //undefined | |
var a = 'local' | |
} |
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 name = 'Peter'; | |
model.findOne({name: new RegExp('^'+name+'$', "i")}, function(err, doc) { | |
//Do your action here.. | |
}); |
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.auto({ | |
getTempIdProducts: getTempIdProducts //Получаем массив айдишников продуктов | |
, getProductsById: ['getTempIdProducts',getProductsById] | |
}) | |
function getTempIdProducts(cb){ | |
Home.findOne({user:req.user.id}).exec(function(err, home){ | |
if(_.size(home.temp)){77777777777777 | |
home.temp.forEach(function(temp){ | |
arr.push(temp.id) |
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
<snippet> | |
<content><![CDATA[console.log(${0:$TM_SELECTED_TEXT});]]></content> | |
<tabTrigger>cl</tabTrigger> | |
<scope>source.js</scope> | |
<description>console.log</description> | |
</snippet> |
NewerOlder