Today I Learned

You can write better jQuery - A DRY approach

From this
    buttonClass: 'btn btn-default',
    buttonWidth: '100%',
    buttonClass: 'btn btn-default',
    buttonWidth: '100%',
    nonSelectedText: '---',
To This
<select class="js-multiselect" 
$('.js-multi-select).each(function () {
	let options = {};
		.map(property => options[property[0]] = property[1]);


And never go back for adjustments in the script file ever again.

Work with "unsafe" HTTPS on localhost in Chrome

If you work with HTTPS connections on your localhost development environment, you will often get an un-secure notification from Chrome, and this will be getting annoying.

To disable those notifications in Chrome type this in your address bar:


search for:

Allow invalid certificates for resources loaded from localhost.

and click on "Enable". Done!

As a precaution: You should use separate browsers for personal use and another for development. I do development in Chromium and my regular browsing in Safari.

Modifying .times built-in objects in JavaScript

Never modify JavaScript's standard built-in objects. That's what they say.

But you're at this hackathon stuck with JS missing Ruby's .times iterator and that's what JS's prototypes are for after all.

Here's how you do it:

String.prototype.times = function (n) {
    for (var i = 0; i < parseInt(this); i++) {
var myFunc = function () { console.log('Hello World') }


"Hello World"
"Hello World"