Repeat after me: JavaScript does not have classes JavaScript has objects. Each object has a prototype, which is either null […]

This function does the work. function splitAfterXWords(to_split, words){ regex = new RegExp(“(([\s;:!,.?”‘’]*[^\s]+){“” + words + “”})(.*)””)

Easily create cookies with vanilla javascript. function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() […]

Ajax is asynchronous by definition, but sometimes you have to wait for the completion of a transaction. How? $.ajaxSetup({ async: […]

node-email-templates is a neat add-on for Nodemailer which allows you to store and render HTML/Text. The only problem is that […]

You can only close window created by yourself. So there is a trick for that: window.open(”, ‘_self’, ”) window.close()

Google WebFont config allows you assign a active function that will be executed when all fonts are loaded. The problem […]

textboxId.onkeydown = function(e) { if (!e) { var e = window.event; } // Enter is pressed if (e.keyCode == 13) […]

So, I was working in a project with about 2MB of assets being loaded everytime without a good cache and […]

No need for the js-ctypes and hacks. For example on windows: The FindWindow trick to get the handle for chrome […]