If you’ve ever created a website, you’ve surely used jQuery.
But hang on a minute – do you really need jQuery?
The answer is, as usual, complicated… but fascinating!
For example: the self-executing function.
What in the Sam Hill is that all about?!
Chrome 94 was recently released with a new feature: Idle Detection.
Much has been said about the diabolical nature of this new capability in Chrome…
Thing is, while we can be forgiven for doubting Google’s motives in adding this feature, it just so happens that Idle Detection is actually quite safe – and useful!
Until now, apps were for smartphones and tablets. But that’s all about to change with PWAs: Progressive Web Apps!
PWAs are a new(ish) type of app that is web-based.
That means you can use the same app on your phone, tablet, desktop, or laptop – whether you use Windows, linux, or Mac.
Progressive Web Apps also work differently than normal apps, making them a bit more secure and privacy-oriented than traditional native apps.
So, what are these things and how do they work?
Ah yes, the Mobile Revolution!
In desktop web browsers, you generally get a web inspector / debug console that lets you do all kinds of fun stuff, including debugging your JS code.
But on mobile, well, no such luck.
In fact, most mobile browsers give you absolutely nothing! Fortunately, there’s a neat trick that fixes everything.
(Updated February 2021 for PikaJS 1.2)
I had been using jQuery and PrototypeJS, and I needed to ditch PrototypeJS at long last.
My colleague Michael Franzl said, “Hey! Check out this Balalaika thing!”
So I did.
Unfortunately, Balalaika doesn’t give you many methods to do cool stuff. That’s left as an exercise for the programmer…
So, I decided to make my own jQuery, and PikaJS is the result!
Cookie Consent laws: you have surely seen them.
The reason for this is a very stupid law implemented in the European Union that is supposed to protect people from… well, actually, it doesn’t protect anyone from anything. Okay, technically, it protects you from your sanity.
Especially if you use Google Adsense to put ads on your web site, you probably have received an e-mail from them telling you that you must have a Cookie Consent thingie on your site by the end of September 2015 in order to comply with yet another EU cookie law.
Right, so, how do you add cookie consent to your site – quickly and easily?
You have probably encountered embed codes before, but they may seem like a bit of a mystery.
An embed code is, in short, a bit of HTML that allows you to embed part of another web site on your own – like a YouTube video, for example.
Embed codes come in two general flavors these days, and each has its strengths and weaknesses.
So, how do embed codes work? Why are some hugemongous, and others teeny-tiny? Are iframe tags really the spawn of the devil?
Normally, we do this with setTimeout().
For repeatedly calling some function every X milliseconds, one would normally use setInterval().
Well, that’s fine. But what if you want to so something 10 times, and delay 3 seconds between iterations?
The solution is not as obvious as it appears…
But it is simple!
In the case of WP MU, the best solution that I could find does include a plugin – but you can write it yourself in about 10 seconds. In writing the plugin yourself, you will also know how to maintain it yourself. Even if you don’t know much about PHP, this one’s a piece of cake!
So, here’s how to convince WordPress MU to play nice with the HTML in your posts…