All posts by Jay Versluis

About Jay Versluis

Jay is a medical miracle known as a Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

How YouTube trimmed my 3 hour video to a 6 second clip – Funny Fail Story

I wanted to share a tragically funny YouTube story with you. It has to do with a copyright claim I’ve received on one of my recent Twitch streams, and a “helpful” tool YouTube offer to alleviate such a problem. Grab a coffee and prepare to be amused.

I was playing Cube Escape: Paradox on Twitch, and we really got into it. It’s an exciting TwinPeak-esque game with a very atmospheric soundtrack. In fact, the first part is free to play, and there’s a free movie you can watch too. Twitch only saves game broadcasts for up to 60 days, so I transfer them to YouTube for posterity, and to reach another audience at the same time. In fact, I upload my Twitch streams both to my Main Channel for a few weeks before making them unlisted, and also to my Gaming Channel for good. It’s a strategy that keeps my main channel tidy going forward.

Continue reading How YouTube trimmed my 3 hour video to a 6 second clip – Funny Fail Story

How to transfer Stardew Valley save files between PCs, Macs and iOS Devices

I love Stardew Valley, and it’s super exciting that save games can be transferred between multiple platforms. It’s not difficult if you know how, but sometimes it’s the little things where you get stuck – so before I forget again, here’s what I’ve been able to transfer and how. I have the game on PC (from Steam) and from the Apple App Store on multiple iOS devices. I’ve also got it working on my Mac, and I can transfer my game onto all these platforms.

The game saves themsevles are text files inside a folder. We need the whole folder, which is named something like YourName_123456789. Even if you have two save games with the name name, the number will be different. To transfer a game, simply copy the whole folder in question onto the target platform.

Here’s where you find the game save files:

Continue reading How to transfer Stardew Valley save files between PCs, Macs and iOS Devices

What is the path to .NET Core SDK on macOS

I thought I’d look into C# development for a bit, and the first hurdle I came across is that I didn’t know the path to the .NET framework when I tried it out on my Mac. I did some digging and found that after installing it from here, the framework (SDK and Core Runtime) are installed here:

Super! I should now be able to call the dotnet command from a Terminal window, but for that I need to add that path to my $PATH variable. Yes… how do I do that again…?

Adding dotnet to your local PATH on macOS

You’d think that after working with Mac and Linux for over 10 years, and being confident on the command line, I’d remember something as trivial as this – but I frequently forget. Sigh! Best write it down somewhere. Here’s a good place, before I make this a separate note.

To see what’s in the current path, we can do this:

This will give is a (more or less) long string of paths that our shell will traverse before giving up with “command not found”. To add to this long list, we should copy it, then add a path of our choice, separated by a colon. Like this:

For dotnet, we want to add the path to the command, not the actual command. Hence we need to do this:

Now we should be able to type dotnet anywhere in our Terminal session and get something like this (rather than “command not found”):

Let the fun begin!

Removing the latest Kernel in CentOS

I’ve had a power cut recently, which seems to have corrupted the latest Kernel I have installed on my CentOS 6 server. I can boot into the previous one just fine, but of course if I forget to make a choice on startup, the server doesn’t start up. That’s annoying.

Thankfully there are ways to either fix the latest version, remove it, and even exclude a particular version from future updates. Here’s what worked for me on CentOS 6:

Continue reading Removing the latest Kernel in CentOS

Including Custom Posts on Archive Pages in WordPress

By default, Custom Posts don’t show up on regular Archive Pages. They still show regular posts, but none of the Custom Post Types are included. I suppose you’d have separate pages with custom queries for that. In my project however, which consists mainly of Custom Posts, it made sense to use the regular WordPress queries to simply include my Custom Posts.

I found an elegant solution that makes this happen:

This will hook right in before the query reaches the theme and adds my own “games” post type to the query. The double-if statement at the top makes sure this only happens on archive pages. Amend this to your needs, for example by using is_home or is_category instead. Replace ++ with two ampersands (I can’t work out how to make WordPress print them properly, and believe me I’ve tried hard).

Note that the hook will not be executed when the search is executed in the admin area. Doing so will show an “invalid post type” error.

Thanks to Tomás Cot and Mathew for their approaches to this solution.

Accessing Custom Taxonomy of a Custom Post Type in the_loop

I was wondering how to access the custom taxonomy of my custom post types so it can be mentioned in the_loop. To continue my example from earlier posts, I have custom post type of “game”, with a custom taxonomy of “platform”. When I list a game, I’d like to show the platform in a list after its title.

On regular posts, I have access to access to both categories and tags using the get_the_category() or get_the_tags() functions. For my project I have a custom query for the custom post type, and I’m using a custom taxonomy on it. I’d like to find out the name of that custom taxonomy. How do we do that?

We’ll use get_the_terms(), which is used by WordPress for both the above functions under the hood. Here’s how we can display all taxonomies of one type (must be used in the_loop):

Thanks to Ankur Bhadiania for this tip.

How to fix “active developer path does not exist” with git on macOS

I’ve recently removed Xcode from my ageing MacBook. Ever since then, I’m getting an error when I try to run git from the command line. The error goes something like this:

That’s because Xcode had installed several command line tools provided by Apple, and one of them was Git. I thought simply installing it via Homebrew would do the trick but alas that too brings up an error message, albeit a different one. Somewhat frustrated, I was wondering how I was ever going to run Git from the command line again.

I did some testing and found a fix to this issue. Here’s what worked for me.

Turns out that I had a symbolic link (or rather a stub) at /usr/bin/git, a place at which git might indeed be expected to live. This however redirected to a no longer existent Xcode installation, or more precisely the xcrun command. All I had to do was rename the symbolic link with admin privileges:

Once that was taken care of, I could download the macOS installer from the official Git-SCM website. I found it under Downloads (it’s not the GUI version, just the command line version at the top of the page). It’s a .pkg file that will install git to /usr/local/git, and places symlinks into /usr/local/bin and /usr/share/man/.

Lo and behold, after the quick and painless installation, I could simply type git from the command line and the above error was gone, and git was operational again.

How to add FTP sync in Visual Studio Code

To my delight I found out how to add an FTP destination to Visual Studio Code. It’s an extension called sftp by liximomo, available for free from the VS Marketplace. Here’s how to install, configure and use it on both Mac and Windows.

Obtain it by selecting the extensions symbol in the sidebar (the bottom one, consisting of four little squares) and enter sftp in the search box. Click the green install option to proceed.

Continue reading How to add FTP sync in Visual Studio Code

How to add the path to PHP in Visual Studio Code

I’ve recently started using Microsoft’s Visual Studio Code on my Mac. It works great, and I really like its simple useful features. The installation and most of the configuration worked flawlessly on my Mac and I was up and running very quickly. I had assumed it would be the same on Windows, but of course that wasn’t the case. Nothing is ever easy in Windows, is it?

The error I got was with two PHP extensions: PHP Executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting.

Hey sure, I get that. The extension needs the location of my local PHP installation. No problem, I can provide that… but how??? You click on Open Settings and expect to just navigate there – but that would be too easy. All we get is this:

Then you think, ah OK, it must be in that mysterious settings.json file, but all that does is to open a new coding window, with two curly braces. How the hell is anyone going to know what the syntax is? It surprises me that the rest of Visual Studio Code is so good, and something as simple as am option to browse to (or even find itself) what some component is looking for isn’t there? Oh Microsoft, you haven’t changed a bit in 30 years!

Well here’s what to put in that settings.json file:

I know. Crazy. Not a syntax I would have dreamt up in 100 years. This can be written on the same line, and it looks like it’s a key value pair to me. The second parameter points to my local XAMPP installation, so feel free to point it to your own PHP location.

Bizzarely, instead of regular backslashes, make sure to use double-backslashes. Because… you know, reasons. Escaping things or whatnot, I have no idea. All I can tell you is that it works.

This tip comes courtesy of Mohamed Elrashid on StackExchange. Thank you, Mohamed!

Note to self: I believe had PHP been set as an environment variable to PHP been set in System Properties, there is a chance that Visual Studio Code would have found it upon first run. That’s what happened on my Mac, so I’m assuming it’s possible on Windows as well. It’s also what that mysterious error message at the beginning alludes to.

How to create Custom Post Types in WordPress

I’ve been working on a game database that’s powered by a vanilla WordPress instance. For the project it made sense to create a new post type (game), as well as a custom taxonomy (platform). I didn’t want to use a plugin and instead opted to create the new post type as part of the child theme’s function.php file.

Here’s how I did it.

Continue reading How to create Custom Post Types in WordPress