You need to add content editor or script editor webpart in the site where you have these long lists. In that webpart you need to add the code from the site you provide.
I have used same code in my test site home page. You can check it here:
[
code demo]
Let me know if you have any other query.