Categories
Computers

Mastodon Icons!

It took some doing, but I finally have a Mastodon icon for my social media menu. It may not seem like it’s important, but I’m really nit-picky about this crap.

A picture of the social media icons on my site (menu and footer).
Yay!

Turns out it took a bit of doing. I installed Add Fediverse Icons to Jetpack, then (thanks to the developer of that plugin) I added this snippet he wrote for me:

add_filter( 'walker_nav_menu_start_el', 'my_apply_icon', 100, 4 );
function my_apply_icon( $item_output, $item, $depth, $args ) {
	$social_icons = array(
		'Diaspora'   => 'diaspora',
		'Friendica'  => 'friendica',
		'GNU Social' => 'gnu-social',
		'Mastodon'   => 'mastodon',
		'PeerTube'   => 'peertube',
		'Pixelfed'   => 'pixelfed',
	);

	if ( 'social' === $args->theme_location ) {
		foreach ( $social_icons as $attr => $value ) {
			if ( false !== stripos( $item_output, $attr ) ) {
                                $item_output = preg_replace( '@<svg(.*?)</svg>@', '', $item_output );
				$item_output = str_ireplace(
					$args->link_after,
					'</span>' . jetpack_social_menu_get_svg( array( 'icon' => esc_attr( $value ) ) ),
					$item_output
				);
			}
		}
	}

	return $item_output;
}

This added the icon to successfully to my menu. However, it was giant. I noticed in the web inspector in Firefox, that the bounding box for the SVG was huge. I changed it to be 24 pixels tall like so:

.icon.icon-mastodon {
  height: 24px;
}

Finally, things are good!

Edit: I keep all my CSS edits in Git.

Categories
Misc

Link Expiry

We all know it. You search for an issue, or topic you’re interested in, click a few links and boom. Dead end. The page no longer lives there, the domain is gone, or the server ended up at the bottom of a river. Even my website is no exception.

While hypertext documents shouldn’t change, we all know they can, and will do so often. Which is why we have such interest int tools like archive.org and the Wayback Machine. These tools regularly scrape, or have users submit interesting material for archiving. It’s frequently used to ensure a particular version of a page or site is preserved.

I started thinking about this because I read an article about strategies for linking to obsolete websites (thanks Beko Pharm). One was to use a periodic link checker to find stale or broken links on your site. Optionally swapping out outdated references with fresh ones, or with links into the Wayback Machine. While this is all well and good, I think it might be more useful to self-archive sites. Use something like wget to pull down the document and associated resources and host it yourself (statically), or at least provide an archive for people to download and inspect.

Has anyone given this any further thought? It doesn’t sound like a technically complicated project, but I’m sure someone has already trodden down this path and came to some sort of outcome or reason it’s not worth it.

Categories
Computers

Web Development

I’ve been out of the game for a long time. I used to eat, sleep, breathe and talk web development. Drupal, mainly, but I was dealing with JavaScript in the form of a nascent Node.js and the initial notions that maybe we didn’t need all that jQuery for simple page interactions. The landscape was at least understandable and everything was contained in it’s own playing field.

Since then, JavaScript has exploded into basically everything, templates, UI components, threading and more. Node grew up and became a bloated mess that we require for everything, including desktop apps via Electron. And holy crap the framework and library world might as well be written in an entirely different language.

I’m not going to lie. I wish I could keep up. Just learning something new, like CSS grids is enough to soak up an afternoon. React, Vue and Angular don’t even seem like tools for websites, as much as they seem like replacements for them. Why bother with spicing up HTML when you could just let the language build the whole damn thing for you? I mean, other than requiring your users to bear the burden for generating and rendering the page. Oh, and we can run JavaScript on the server now, so yay for that?

Ugh. It feels like the world has passed me by. I guess I don’t mind, much of the stuff is not so much conceptually new as it is built in new ways using new language features or new methods of doing things. That’s not a bad thing. The state of the art has left me behind and I’m just reminiscing like the old man I am.

Categories
Misc

Restart

So, I have a bad habit: I break things. Usually things that I’m tinkering with, either to understand better, to “optimize”, or to just find out how the damn thing actually works. My website is a prime example of this behavior. I broke it recently, and instead of just restoring it like magic, I moved it to the NameCheap shared hosting instead of their (quixotically) more expensive managed hosting.

I also host a number of different applications on this hosting, so it ends up being a better deal. I’ll do my best to import some latent desired posts, like Garrett’s quotes, but that’ll come in time. Right now, I’m just shifting stuff around and making sure things are more suited to my desires. So far, so good.

Categories
Computers Rants

VPN for All the Wrong Reasons

I’m not a political dissident. Moreover, I’m pretty uninteresting. SSL-secured websites are more than encrypted enough for my purposes. So why would I want to start looking at VPN? Website filtering. I connect to some of my self-hosted solutions, which seem to be blocked or, at the very least, poorly peered on the WiFi at the locations I frequent.

Ideally, I’d like to use the “built-in” (at least, to NetworkManager) OpenVPN solution to make it easier. I do have a pfSense firewall that I could hook into, but it’s sitting on a Comcast/Xfinity consumer service. I guess I’ll have to do some investigation as to port usage.

There are lots of different VPN services out there. With the rise in the privacy awareness (the awareness of the lack of privacy online), there are really good and cheap options. Even the OpenVPN folks seem to have their own service, called PrivateTunnel, which is interesting and cheap. I’ve also been looking at NordVPN, because of their ties with the SomethingAwful forums, great ratings and decent popularity.

I guess I’m spoiled for choice. Any ideas for service? I’d like to not spend a huge amount on services. Month-to-month would be better than yearly pre-paid. Leave a comment below.