1. Minimize TCP connections
Ensure the web server uses Keep-Alive
headers.
2. Reduce DNS look-ups
DNS look-ups are the first thing blocking your HTTP requests.
console.log(1); | |
(_ => console.log(2))(); | |
eval('console.log(3);'); | |
console.log.call(null, 4); | |
console.log.apply(null, [5]); | |
new Function('console.log(6)')(); | |
Reflect.apply(console.log, null, [7]) | |
Reflect.construct(function(){console.log(8)}, []); | |
Function.prototype.apply.call(console.log, null, [9]); | |
Function.prototype.call.call(console.log, null, 10); |
const addCounter = (list) => { | |
return [...list, 0]; | |
}; | |
const removeCounter = (list, index) => {\ | |
return [ | |
...list.slice(0, index), | |
...list.slice(index + 1) | |
]; | |
}; |
// Background mixin | |
@mixin strips($color, $angle){ | |
$color: saturate(lighten($color, 2%), 10%); | |
background: $color | |
linear-gradient($angle, $color 0%, $color 10%, | |
mix(black, $color, 5%) 10%, mix(black, $color, 5%) 20%, | |
mix(black, $color, 12%) 19%, mix(black, $color, 10%) 21%, // Thin line between gradient | |
mix(black, $color, 10%) 20%, mix(black, $color, 10%) 30%, | |
mix(black, $color, 17%) 29%, mix(black, $color, 15%) 31%, // Thin line between gradient | |
mix(black, $color, 15%) 30%, mix(black, $color, 15%) 40%, |
From currying to closures there are quite a number of special words used in JavaScript. These will not only help you increase your vocabulary but also better understand JavaScript. Special terms are normally found in documentation and technical articles. But some of them like closures are pretty standard things to know about. Knowing what the word itself means can help you know the concept it's named for better.
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
/* WebKit browsers */ | |
::-webkit-input-placeholder { | |
color: rgba(#fff, .2); | |
} | |
/* Mozilla Firefox 4 to 18 */ | |
:-moz-placeholder { | |
color: rgba(#fff, .2); | |
} | |
/* Mozilla Firefox 19+ */ | |
::-moz-placeholder { |
#Selectores CSS
Los 30 selectores CSS que debes memorizar ( Un artículo de tutsplus.com )
#1. *
* {
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.