Updates from Jay Versluis Toggle Comment Threads | Keyboard Shortcuts

  • Jay Versluis 5:55 pm on March 16, 2018 Permalink | Reply

    Categories: Windows ( 21 )

    How to shutdown Windows 10 without applying updates 

    Although most of Windows 10 keeps getting better with every iteration, some things just never change. Windows Updates are one of those. They always want to download and install when we really don’t have the time or the battery power.

    What’s worst, Microsoft have removed the graphical option to simply shutdown the system – and all we’re left with are two choices: “Update and shutdown”, or “Update and restart”.

    What if all we want to do is to shutdown or restart WITHOUT applying those updates? Perhaps we’re out and about, running on an already near-depleted battery? Or we’re in a hurry and would like to leave the update for when we have more time, or a power outlet?

    Fear not, there is a way to do these things – even if they don’t come up in the Start menu anymore.

    (More …)

  • Jay Versluis 11:43 am on March 14, 2018 Permalink | Reply
    Tags: , , , VIC-20   

    Categories: Commodore ( 26 )

    String Operations on Commodore Computers 

    Commodore BASIC has some interesting and simple string functions built in. Three of them are self explanatory: LEN, LEFT$ and RIGHT$. But others, like the mysterious MID$ and INSTR functions, are a little tricker, and I can never remember how they works.

    So here’s a quick recap on how they all work.

    LEN (A$)

    Returns the length of any given string. For example,

    a$=”the cake is a lie”

    print len (a$)

    returns 17, which is the number of characters in our string.

    LEFT$ (A$,X)

    The LEFT$ function takes the x left characters from a given string. Here’s an example:

    print left$(a$,3)

    We get “one”, because those are the 3 leftmost characters in our string a$.

    RIGHT$ (A$,X)

    Likewise, RIGHT$ takes the x right characters from any given string:

    print right$(a$,5)

    Here we get “three”, because those are the 5 right characters of a$.

    MID$ (A$,X,Y)

    MID$ is a little more complex. It takes x characters from a given string, starting at position y. Let’s look at our earlier example again:

    print mid$(a$,5,3)

    We get “two”, because those are the 3 characters, starting at position 5. The first position in all these string operations counts as one rather than zero.

    But did you know that MID$ can also be used to assign and replace different characters in a string? Consider this:

    print a$

    Now we’ve replaced the 3 characters in our string with another string, starting at position 5.

    I had no idea it cold do that! All these string operations work in all variations of the Commodore BASIC, except for the MID$ assignment which only works on the Plus/4 and the C128.


    INSTR (A$, B$)

    On the Plus/4 and C128, we can even check if one string is contained in another and at which position this occurs. Consider this:

    a$="the cake is a lie"
    print instr(a$,b$)

    In our example, INSTR returns 5 because “cake” has been found at position 5 of “the cake is a lie”.

    We can also specify a position from which the search shall be started like this:

    print instr(a$,b$,6)

    Now INSTR returns 0 because “cake” has not been found beyond position 6 of our input string.

  • Jay Versluis 11:04 pm on March 13, 2018 Permalink | Reply

    Categories: Commodore ( 26 )

    How to play sounds and music on the Commodore Plus/4 

    The Plus/4 has a total of two voices thanks to its integrated TED chip, which is also responsible for rendering text and graphics on screen. The first voice can play square waves, while the second one can generate either square wave sounds or white noise.

    Let’s see how we can make him play a tune.

    We can use some BASIC keywords to make the Plus/4 be all musical. First we need to turn up the volume by using the VOL command. We can set this to anything between 0 and 8.

    VOL 8

    Next we can use the SOUND command to make each channel play a note, like so:

    SOUND 1,400,60

    This will play a one-second long note on channel 1.

    (More …)

  • Jay Versluis 5:00 pm on March 4, 2018 Permalink | Reply
    Tags: Facebook, ,   

    Categories: Screencast ( 76 )

    How to turn off PayPal Notifications in the Facebook Messenger App on iOS 

    In this video I’ll show you how to switch off those super annoying PayPal notifications in the Facebook Messenger App in iOS on my iPhone 6s Plus. I’ve recorded this video on iOS 11 in March 2018.

  • Jay Versluis 5:17 pm on February 28, 2018 Permalink | Reply  
    Categories: WordPress ( 140 )

    How to add code to the header in WordPress 

    WordPress has a hook that lets us add arbitrary HTML code to the <header> tag of a website. Several plugins can be found that accomplish this, but it’s so easy to do that a plugin is often overkill.

    Here’s how you can execute an arbitrary PHP function using the wp_head hook:

    // write some text as part of the header 
    function writeSomeText () { 
        echo 'Hello from my new header function.'; 
    add_action('wp_head', 'writeSomeText');

    This example inserts some text into the <header> portion of the website. HTML tags can simply be written using echo, including double quotes.

  • Jay Versluis 11:07 am on February 19, 2018 Permalink | Reply  
    Categories: WordPress ( 140 )

    How to show a list of all articles in WordPress 

    There’s a handy function in WordPress called wp_get_archives(). With it we can create a lot of useful output with just a few lines of code.

    To list all articles ever published on a site, we can do this:

    Here we setup a list of arguments and then give it to the function, which in turn gives us a nicely formatted list of every published article.

    If we set the show_post_count argument to true, and replace the type argument to something like “yearly” or “monthly”, we’ll get clickable a list similar to this:


    • April 2015 (20)
    • March 2015 (11)
    • February 2015 (2)
    • January 2015 (7)
    • December 2014 (4)
    • November 2014 (12)

    The number in brackets shows up when the show_post_count argument is set to true instead of false.




    We can even find out how many articles have been published on the entire site by using the wp_count_posts() function. Here’s how to use it:

    $totalPosts = wp_count_posts()-&gt;publish;

    $totalPosts now holds the amount published posts. We can also query drafts or posts of any particular post type too if we wanted to (such as all status updates or video posts).

  • Jay Versluis 1:51 pm on January 29, 2018 Permalink | Reply  
    Categories: How To, Screencast, WordPress ( 31 )

    How to fix the “Occasional White Screen of Death” Error in WordPress 

    In this video I’ll show you how to fix an odd phenomenon I’d like to call “The Occasional White Screen of Death”. Here’s what happened: (More …)

  • Jay Versluis 6:38 pm on November 5, 2017 Permalink | Reply

    Categories: WordPress ( 140 )

    How to disable JetPack nag messages in the WordPress Admin interface 

    I really like WordPress, and I really like JetPack. I use the plugin on many client websites, who usually have their own WordPress.com  account, which is necessary to enable the plugin successfully.

    Most of them however choose not to sign up for a payment plan, which as of 2017 leads to (now rather annoyingly frequent) JetPack upsell messages at the top of the admin screen. So I as the administrator, am constantly exposed to such messages, and I was wondering how to suppress them – not being the target audience here.

    Thanks to a super helpful article by Matt Medeiros I found a great solution with this one-liner of code he as kindly supplied on his website, together with his opinion on such messages:

    /* remove JetPack upsell messages */
    /* https://mattreport.com/disable-jetpack-upsell-ads/ */
    add_filter( 'jetpack_just_in_time_msgs', '_return_false' );

    Add this to your child theme’s functions.php file and those admin nags are history!

    Thanks Matt!

  • Jay Versluis 10:35 am on September 26, 2017 Permalink | Reply

    Categories: Linux ( 96 )

    How to find out which version of GNOME you’re using 

    In the GNOME desktop, there is no obvious way to tell which version you’re running by way of the GUI. Instead, we need to consult the command line and try out a couple of commands to find out more. Here’s how.

    Let’s open a Terminal session and do some hacking.

    GNOME 2.x

    If you’re running GNOME 2.x (under CentOS 6 for example), you need to run the following command:

    gnome-session --version
    gnome-session 2.28.0

    You may need to prefix this command with sudo, otherwise it will tell you that you’re alrady running a GNOME session.

    Should the above not work, you’re likely on GNOME 3 (see next).

    GNOME 3.x

    GNOME 3 uses a different command, namely this one:

    gnome-panel --version
    gnome-panel 3.24.2

    If you don’t know which version of the GNOME panel you’re using (which is likely), try both commands. One of them will work, the other one won’t.

  • Jay Versluis 12:47 pm on September 16, 2017 Permalink | Reply  
    Categories: WordPress ( 140 )

    How to fix the Visual Editor or Text Editor in WordPress when it’s not working 

    I had a weird phenomenon on a Multisite installation the other day. I can’t tell you with which update exactly it happened, as I only write a post on that site once every couple of months, but it must have been around the 4.7 or 4.8 upgrade. Here’s what was happening:

    I could log into the site fine, I could display all posts in the backend fine, but editing them, or creating a new post (or page) resulted in an unresponsive editor window. Neither the Visual Editor nor the standard Text Editor wanted to accept any keyboard input. Moreover, none of the buttons could be pressed, including the Publish button.

    The rest of the admin interface looked and behaved completely normal. I could even write posts from the iOS app, so fundamentally the installation wasn’t broken, just the editor part of it. Made no sense to me at all.

    Things I’ve tried

    I tried the usual tricks for getting rid of such a spurious affair:

    • re-install WordPress manually
    • disable all plugins
    • use a different default theme (in fact, I’ve tried several)
    • try logging in as a different user
    • since this was multisite, try writing a post on another site (same issues there)
    • since this was an installation managed from Plesk via the WP Toolkit, try more lax security settings

    I probably tried other things, but none of it was making that editor working again. I didn’t understand what was going on.

    The Solution

    The solution came after extensive research, one part of which lead me to this thread in which Peter Luit explained a related problem that he could fix by defining a constant in the wp-confg.php file. I had never heard of it either:

    define('CONCATENATE_SCRIPTS', false);

    Turns out that this constant is enabled by default and means that all JavaScript files are loaded with a single call, rather than multiple calls to multiple files. The idea is that, if your site is healthy, and every single JavaScript file is working fine, all of them together will execute and work fine too. However, should one in the middle not work so well, then the rest of them won’t be executing, and I guess that’s what happened on my installation.

    By setting this constant to false, each JavaScript file is loaded individually, resulting in more http requests to the server (potentially making the overall load time slower), but every JavaScript file can be executed individually. If one isn’t working, none of the others are impacted. Hence, now my editor is working again, however I still have at least one JavaScript file that has an issue executing. Finding which one would be the next step.

    So this constant isn’t a “fix” as such, it’s part of a debug strategy. But it’s great to have my site back up and running so I can continue to write posts.

    Thanks for sharing, Peter!

    • My site 10:38 pm on September 25, 2017 Permalink | Reply

      Hi, I try everything but still not work. All do like you and i can not swich from text to visual when edit post. When i start new post i can swich and that it work but if i write one word in post i again can not change visual to text or text to visual

      • Jay Versluis 10:41 am on September 26, 2017 Permalink | Reply

        The trouble is that there are literally a million reasons why the text or visual editor might stop working. The web is full of disappointed people trying to figure to why, and there are a great number of solutions out there. Most of the time, it turns out to be a plugin conflict or a conflict between the theme you’re using and a plugin. To make sure WordPress itself is working fine, start by switching off ALL plugins and switch to one of the recent default themes (like TwentySeventeen, TwentyThirteen, etc). Then see if the editor works. If it does, switch to your own theme. Try again. If all works well, switch on one plugin at a time and test after each plugin.

        If it’s not your theme or your plugins, try a re-install. Then a database repair. Finding those types of problems is really time consuming and extremely tricky. All I can wish you is good luck for your hunt to find the culprit!

compose new post
next post/next comment
previous post/previous comment
show/hide comments
go to top
go to login
show/hide help
shift + esc