( function( win, doc, s_add, s_rem ) { | |
if( doc[s_add] ) return; | |
Element.prototype[ s_add ] = win[ s_add ] = doc[ s_add ] = function( on, fn, self ) { | |
return (self = this).attachEvent( 'on' + on, function(e){ | |
var e = e || win.event; | |
e.target = e.target || e.srcElement; | |
e.preventDefault = e.preventDefault || function(){e.returnValue = false}; | |
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}; | |
e.which = e.button ? ( e.button === 2 ? 3 : e.button === 4 ? 2 : e.button ) : e.keyCode; | |
fn.call(self, e); |
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
CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.
In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.
First, let's illustrate the 3 styles by implementing
This this super outdated, see v2 here
https://egghead.io/
https://github.com/trekhleb/javascript-algorithms
https://habr.com/post/359192/ алгоритмы на js все
https://www.youtube.com/watch?v=j4_9BZezSUA event loop
https://fseby.wordpress.com/2016/02/25/практическая-вводная-в-монады-в-javascript/
https://habrahabr.ru/company/mailru/blog/327522/ (Функциональное программирование в JavaScript с практическими примерами)
Pre-installation from live OS
This setup of Ubuntu with LUKS and LVM is tested on Ubuntu 18.04.
Boot Ubuntu from a Live OS and select the option to try Ubuntu without installing. Follow the steps I've outlined below. Let's assume you're installing to /dev/nvme0n1.
- Partition the drive with your tool of choice: I used gparted to set mine up.