Live Schedule (2019)

Since the beginning of this year, I’ve started doing regular live streams on YouTube.

Here’s the current schedule:

3D Shenanigans

  • Fridays at 4pm EST (9pm UK / 10pm Europe)

It’s about workflow, scene building and various other 3D tips and tricks. I’musing DAZ Studio, Blender, Marvelous Designer, Photoshop and related apps to build something. Feel free to submit questions and suggestions, and join the chat to get involved.

Watch past episodes here.

Subnautica Saturday

  • Saturdays at 4pm EST (9pm UK / 10pm Europe)

This is hang time after a hard week’s worth of work. Let me be your tour guide on planet 4546B and watch the mesmerising story of SUBNAUTICA unfold. We’ll watch some stunning realtime graphics while talking about anything from workflows to graphics cards to tax returns.

Watch past episodes here.

Tune in on YouTube if you’re free 😎

How Quality Options work in YouTube, Twitch and Mixer streams

When we watch a video online, we usually get an option to pick a quality/resolution at the bottom right of the player. It’s often represented by a little gear icon that lets us choose either “auto” or a specific format like 480p or 720p.

But when we watch a live stream, those options might vary or be completely absent.

In this article I’ll discuss why that is and how different services deal with Quality Options in Live Streams.

Continue reading How Quality Options work in YouTube, Twitch and Mixer streams

How to exchange data from PHP to JavaScript in WordPress

I was involved in writing a small plugin project last week, for which I found myself reading a database value from WordPress (in PHP) that I wanted to use in JavaScript. I don’t do much in JavaScript and it had occurred to me that I had no idea how I should exchange the data.

After some digging I found several posts on this subject, and I found the most straightforward one was by Toby Osbourn. He made me aware of the wp_localize_script() function and gives a brief example. Thanks, Toby!

The function is designed to over localised values for strings to anything that’s printed via JavaScript, but it can really be used for any data we may need. Here’s how I did it:

The PHP Part

This looks more complex than it is, so let’s break it down line by line. Our function is called via the last line here, hooking in to when WordPress calls the footer. The purpose of our function is to insert a bit of jQuery code on the front page, so we’ll begin by making sure that this doesn’t happen when we’re in the Admin Interface. If that’s the case, we’ll simply return without doing anything.

Next step is to initialise jQuery – that’s only necessary if we’re actually using jQuery, so feel free to leave that bit out if you’re so inclined. On this note, WordPress 5.1 only ships with jQuery 1.2.x (no longer supported).

Then it’s time to initialise our own script. In my plugin I have a separate file for that, which is why I’m reading its full path into a variable first ($elv_vanish). To get that full path, the plugins_url() function helps.

Now comes the interesting part: we’re creating an array with two values (random_value and elv_class) and populate them with data. Note the names of the variables in the array, we’ll be able to access exactly those values in JavaScript in a moment. To “transfer” the data, we’ll call wp_localize_script() with three parameters:

  • the name of our own script (elv_vanish in my case)
  • the PHP array we’ve created (elv_data)
  • and a variable we’d like to use in JavaScript ($elv_data to make it easy for my tired brain to remember)

That’s all we need to do in PHP. We’re using an array by the way to enable us to transfer more than a single value. You could use a single variable instead of an array, but an array makes it easy to add values as your project matures.

The JavaScript Part

In order to access our values, we now have an array to play with – namely $elv_data. JavaScript supports dot notation, so any of our PHP array values can be accessed using $elv_data.random_value and $elv_data.elv_class.

It’s super easy – and very exciting I must add 🙂

Further Reading

How to find your Followers on Twitch

Twitch is a little weird in that it doesn’t provide a menu accessible link to a list of your current followers (as of April 2019). After all, if you’ve had a nice conversation with somebody, and you’d like to see when they’re live next, you may want to follow a follower.

Thankfully though, there’s a quick URL hack that’ll show us just the same. Amend this:

where user is your user name. You may need to be logged in for this list to come up properly. For example, you can see who’s following me on Twitch like this:

Hope this helps!

How to connect from your Mac to your Windows 10 Computer

Networking sucks, particularly when Windows is involved. I’m not actually sure why, but I guess it has to do with the fact that deep down, manufacturers and software developer really don’t want us to connect arbitrary devices to suit our needs. It’s just a fact of technological survival I guess.

I’ve recently re-installed Windows on my desktop, and now my Mac cannot connect to Windows anymore. I had to set this up again from scratch. While I remember how to do it, here’s how it (once) worked for me:

Continue reading How to connect from your Mac to your Windows 10 Computer

How to use a PS4 Controller on your PS3

Even after so many years of use, I still love my Playstation 3. I can’t imagine a life without it. As such, I get nervous thinking about the fact that native PS3 Controllers are no longer in production. What happens when my ever so slightly worn out two controllers give up? How will I play my favourite platform games?

Thankfully, Sony made it possible since software version 4.6 to use the newer Playstation 4 controllers on our Playstation 3 systems. Those are available in great numbers and colours, and from what I hear, they even have the same batteries inside as the PS3 controllers did.

Here’s how to pair a PS4 controller on your PS3 console:

  • switch you the PS3 console using a regular PS3 controller (attached or wireless, doesn’t matter)
  • head over to Settings – Accessory Settings
  • select Manage Bluetooth Devices
  • choose Register New Device (the button at the bottom)
  • on your PS4 controller, press and hold the PS and Share buttons together for a couple of seconds, until the light starts to flash
  • select it from the list when your PS3 console finds the controller

And that’s it! Now you can use your PS4 controller with your PS3 console. How cool is that? Now you can use a brand new controller on your old console, or play that multiplayer game you’ve never had a second controller for.

What works and what doesn’t

There’s a small caveat to this setup though: some things don’t work quite as expected. Thankfully that’s not during gameplay, at least I haven’t noticed anything detrimental yet on native PS3 games. Nevertheless, here’s a quick list of idiosyncrasies I’ve spotted:

  • you can turn the PS3 console on using the PS button on the PS4 controller (great!)
  • during gameplay, you cannot use the PS button to bring up the context menu and either quit the game, or turn off the console (not so great)
  • once paired with the PS3 console, the PS4 controller will no longer be paired to your PS4 console
  • even though no longer paired, the PS4 controller still manages to switch on BOTH the PS3 and the PS4 (that’s terrible)

This setup does not work for native PS2 games, like those you’ve bought before they were remastered, such as the GTA series. That’s because in emulation mode, the PS3 restarts and the controller needs to be re-connected, ignoring generic Bluetooth devices (such as the PS4 controller).

Reassigning Controllers

Right after pairing your PS4 controller for the first time, it’ll be dedicated as the next available controller slot. Since you need a regular controller to set it up, it’s likely to be Controller #2. That may not work for some games.

To adjust this, head over to the Settings – Accessory Settings – Reassign Controllers. You can pick which controller number you’d like the current controller to be. Choose 1 for most games.

Hope this helps!

How to add files to a ZIP archive on the Command Line

Before submitting ZIP files to various third parties, I often have the need to ether remove superfluous files from my archives. Until today I’ve never had the need to add a file to such archives. Had that happened in the past, I would have probably just deleted the whole archive and crated a new one from scratch.

Today I felt adventurous and researched a way to add files to existing ZIP files and found a (not-so-obvious) solution to this puzzle, using the -r switch.

Let me show you how it works:

According to the man page, the r switch actually replaces an existing file in the archive, so this command can be used to update files in the ZIP file too. I’ve added the v switch for convenience (it means “verbose” and can be omitted.

Works on Linux and macOS.

Show Me The Cookies: How to list all cookies on your WordPress site

I’ve been working on a new plugin for WordPress called Cookies. It shows you a list of all cookies on your current site. Once activated, you can find this list under Appearance – Cookies.

In addition, you can also display this list to your visitors by adding the shortcode [cookies] to any post or page. Many of those cookies are used by WordPress to track things such as “are you logged in”, so I’ve added an option to filter WordPress related cookies out. This list is available with the [cookies-nowp] shortcode.

I’m still putting the finishing touches on the plugin, but I’m planning to submit it to the WordPress repository. For now, feel free to download it from my GitHub repository.

Let me tell you a bit about how this plugin came to be.

Continue reading Show Me The Cookies: How to list all cookies on your WordPress site

Child Theme Wizard – Version 1.3 released

This morning I felt like a bit of coding, and something that’s been on my to-do list for a while was to update my Child Theme Wizard plugin. It’s been making over 10.000 users happy since 2013.

The main reason for the update was to update the compatibility flag with WordPress 5.1 – it was already compatible with the latest version, it just wasn’t explicitly set. On this occasion I found a couple of other items I could improve upon:

  • updated the link to the WordPress Codex about Child Themes
  • verified compatibility with WordPress 5.1
  • updated social media links (added YouTube and Patreon, removed Google+)
  • added theme version to query, as suggested in WordPress Codex

The last item was new to me and doesn’t make a difference to how your child themes are created, however since the Codex suggests to create child themes this way, I thought I’d better follow best practices.

And one final thing I’ve streamlined was the code itself, both in the plugin and in the generated code. It’s now a bit more spaced out, improving readability and updatability (if that is in fact a word).

You can get the latest version either from GitHub, update from within WordPress, or download it from the official WordPress repository.

How to copy Windows.old to an external drive

After a recent Windows 10 Refresh, I found myself with most of my data missing from my installation – a bit of a surprise, having done Windows refreshes before and seeing that I selected the option to “keep all my data”. Ah well…

However, Windows was kind enough to preserve much of my previous configuration in an folder called Windows.old. As such, I could at least go back to some of the system data that I needed. Thank you, Windows 🙂

Before moving on with major re-installation work, I thought it would be wise to preserve the Windows.old folder on an external drive and make some room on my main SSD. I thought it’s just a simple matter of dragging the folder over – but that was not the case. When I tried, only perhaps 1GB of the total 30GB the folder contained was copied over.

What’s going on here? Why is this happening? My user name is exactly the same as before, why can I not create an exact replica of the whole folder somewhere else?

Continue reading How to copy Windows.old to an external drive