Code Snippets

Snippets to help code faster and solve problems.

document.addEventListener("DOMContentLoaded", function(){
  // Handler when the DOM is fully loaded
});

Tony Lea

6 days ago

Select One:
window.addEventListener('scroll', function() {
    console.log('scrolling');
});

// Alternative version
window.onscroll = function() {
    console.log('scrolling');
};

Tony Lea

6 days ago

Select One:
var top  = window.pageYOffset || document.documentElement.scrollTop,
    left = window.pageXOffset || document.documentElement.scrollLeft;

Tony Lea

6 days ago

Select One:
docker run -d  --name mongo-on-docker  -p 27888:27017 -e MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=secret mongo

Bobby Iliev

2 weeks ago

Select One:
Load More