Select all “obsolete” html elements with yolo-selector!

Never think all npm packages have been created already. The world is full of inspiration if you’re open to it. For example, this Rob Dodson tweet:

After seeing it, yours truly thought: “that sounds like a capital idea!”. So, in a rush of inspiration, the  yolo-selector npm package was born. It is a jQuery extension that adds a pseudo selector :yolo. This selector uses a list pilfered from the Mozilla Documentation for HTML elements that have fallen from grace, like blink, marquee, acronym, font, and many more.

The implementation may be half-joke, but it has tests, and CI and the works. Feel free to create issues if more elements need to be added.

Play YouTube videos filling the browser window

If you are like me, you like using as much of your screen to watch videos on YouTube. The comments, title bar, and the rest of the edge of the screen takes away the possibility of looking at all those 1080p pixels available now.

To make any video fill your browser window, drag the link that says YT Full below to your bookmarks toolbar. You can also right click and save to bookmarks. Then, while on a YouTube video page, click on it. The page will be replaced by the URL of the embedding version of the video, filling the viewport.

[codepen_embed height=”120″ theme_id=”light” slug_hash=”xLMaEw” default_tab=”result” user=”javver”]See the Pen <a href=’https://codepen.io/javver/pen/xLMaEw/’>xLMaEw</a> by Javier (<a href=’https://codepen.io/javver’>@javver</a>) on <a href=’https://codepen.io’>CodePen</a>.[/codepen_embed]

Inside the bookmarklet you will see this:

javascript:u=window.location.toString().match(/v=([^&]*)/)[1];window.location.replace(`https://www.youtube.com/embed/${u}`)

It’s a short script that takes the current URL from the address bar, yanks the video ID from it, and replaces the tab URL with the embedded version URL.

😀

A node package appears: tagged-replace

I’ve recently become acquainted with node.js and it’s been a delight so far. It’s taken some time to get used to a new package manager and build tools and it’s been some time since I last touched ECMAScript (we all know it as Javascript though, right?). In an attempt to get truly familiar with it I’ve ventured to create a module and publish it to the npm.

Continue reading

Zero padded hexadecimal numbers in Java

A quick recipe, converting an int or long like 65 to a string like 000041. It’s useful for converting integer RGB colors to the common #FFBBCC kind of web encoded colors.

 

int number = 65;
String hexString = String.format("%06X", number);
System.out.println(hexString);

:>