Monday, February 17, 2020

JsStacks and MicroTasks, Can you guess the order of the prints?

~/Downloads/text.hmtl.html
<!DOCTYPE html>
<html>
<body>
<button id="myBtn">Try it</button>
<script>
button=document.getElementById("myBtn")
button.addEventListener("click", function(){
   Promise.resolve().then(()=>console.log('Microtask 1'));
   console.log('1');
});
button.addEventListener("click", function(){
 Promise.resolve().then(()=>console.log('Microtask 2'));
   console.log('2');
});
//button.click(); //not the same as click from the user... ..JsStacks and MicroTasks
</script>
</body>
</html>

Sunday, February 16, 2020

Format and Order docker ps

docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" | (read -r; printf "%s\n" "$REPLY"; sort -k 2 )

How to revert comments Youtube layout?

#see video for details  https://www.youtube.com/watch?v=J0L_nYtNlqs #uBlock Origin  https://chrome.google.com/webstore/detail/ublock-o...