Mastodon Autopost Plugin for WordPress

 blog, mastodon  Comments Off on Mastodon Autopost Plugin for WordPress
Oct 302022
 

There are several plugins for WordPress that allow to automatically create a new Mastodon toot (what a stupid name!) for each blog post. I’m using “Mastodon Autopost“. Unfortunately this plugin seems to be outdated and also has a bug that with the current PHP version results in an error/warning message if the post does not have any tags. I was able to fix it though and that fix is amazingly simple.

In line 545 of mastodon_autopost.php there is an if statement using sizeOf() which bombs out because the parameter $post_tags is not an array. Since I am far from being a PHP expert I had to first google that command and found that it isn’t necessary in this case since the foreach that follows later takes care of empty arrays. So the fix looks like this:

    $post_tags = get_the_tags($id);
    // <==== check was here
    if ($post_tags) {
        foreach ($post_tags as $tag) {
            $post_tags_content = $post_tags_content . '#' . preg_replace('/\s+/', '', html_entity_decode($tag->name, ENT_COMPAT, 'UTF-8')) . ' ';
        }
        $post_tags_content = trim($post_tags_content);
    }
    $message_template = str_replace("[tags]", $post_tags_content, $message_template);

If you can see this post on Mastodon, the fix works.

 Posted by on 2022-10-30 at 17:02

I’m on Mastodon now

 mastodon  Comments Off on I’m on Mastodon now
Oct 302022
 

I never really liked Twitter, but I created an account there to be able to

  1. Announce new posts on my blog
  2. Allow some feedback to my blog without enabling the comments

Now I joined Mastodon as @dummzeuch@mastodon.social simply to add another channel for those who don’t want to use Twitter.

 Posted by on 2022-10-30 at 11:55

All known Generics bugs fixed in GExperts code formatter

 Delphi, GExperts  Comments Off on All known Generics bugs fixed in GExperts code formatter
Sep 282022
 

I have just finished fixing all known bugs in the GExperts code formatter that were related to Generics. On top of that I fixed a few others.

I am sure there are still more though, but because I rarely use Generics I haven’t seen them yet. So I need your help: If you have a lot of source code with Generics, please compile a new DLL and try the formatter on that code. Report any bugs on SourceForge.

 Posted by on 2022-09-28 at 18:46

Change order of experts in GExperts Expert Manager

 Delphi, GExperts  Comments Off on Change order of experts in GExperts Expert Manager
Sep 282022
 

Prompted by a post on Delphi Praxis, I just added a new feature to the Expert Manager expert in GExperts (lots of experts here 😉 ): It can now change the order in which the experts are loaded into the IDE.

This may be important e.g. if you are using Andreas Hausladen’s Delphi Speed Up or IDE Fix Pack as those should be loaded before any other plugins.

Note that in order to these changes to have any effect, you need to save them! That’s no longer done automatically.

As there is no new release of GExperts yet, you need to compile your own DLL to get this feature.

Discussion about this post in the international Delphi Praxis forum.

 Posted by on 2022-09-28 at 11:11

RIP Michail Gorbatschow

 none  Comments Off on RIP Michail Gorbatschow
Aug 312022
 

I think we as Germans still cannot really appreciate the effect he had on our country. I also think the war against Ukraine would not have happened if he had been in charge for a few more years, but we will never know.

Rest in peace Gorbi!

 Posted by on 2022-08-31 at 09:13

Installing Webmin on Ubuntu 22.04 server

 Linux  Comments Off on Installing Webmin on Ubuntu 22.04 server
Aug 302022
 

As a follow up to my notes on installing Webmin on Ubuntu 16.04 and 18.04 (on 20.04 it worked as in 18.04) now two additional steps are necessary for Ubuntu 22.04. Those steps must be executed as root:

  1. Convert Webmin’s PGP key to a format that apt can use to verify files:
    cat jcameron-key.asc | gpg --dearmor -o /usr/share/keyrings/webmin.gpg
    
  2. Add that key to the entry in webmin.list like this:
    deb [signed-by=/usr/share/keyrings/webmin.gpg] https://download.webmin.com/download/repository sarge contrib
    

    I got that from a tutorial by DigitalOcean.

 Posted by on 2022-08-30 at 14:04

Where did Microsoft move the underline menu shortcut option?

 Windows, Windows 10  Comments Off on Where did Microsoft move the underline menu shortcut option?
Aug 282022
 

So I don’t forget:

Microsoft seems to love changing the place where they hide useful configuration options. One that I always turn on is “Underline access keys when available” and in Windows 10 it is now in “Keyboard” -> “Change how keyboard shortcuts work” which is about half way down the page just where it won’t be visible without scrolling.

 Posted by on 2022-08-28 at 11:55

Setting colors for Linux ls command

 Linux  Comments Off on Setting colors for Linux ls command
Aug 172022
 

Those people who selected the default colors for the Linux ls command must have much better eyes than I. E.g. I think that dark blue text on black background is very difficult to read, but apparently they think it is fine.

Fortunately it is easy to change these colors by setting the LS_COLORS environment variable. To make that change permanent, I put it into my .bashrc file like this:

LS_COLORS=$LS_COLORS:'di=1;35:' ; export LS_COLORS

I have put this here so I can easily find it whenever I need it. If anybody else finds this useful, you are welcome.

 Posted by on 2022-08-17 at 11:33

added support for TColor and Local Variables to dzDebugVisualizer

 Delphi, dzDebugVisualizer  Comments Off on added support for TColor and Local Variables to dzDebugVisualizer
Jul 312022
 

After making the source code of dzDebugVisualizer available I got interested in Debug Visualizers in general and had a look at how they are supported in Delphi 11. I wrote a visualizer for TColor, based on an old EDN article (now only in the Internet Archive). And after that I simply added that functionality to dzDebugVisualizer. It supports both, the Watch window and Evaluate and Modify dialog. In the latter, there is now a new modifyer key ‘L’ for Co*l*or. The output shows three values:

  • The color name, e.g. “clLime”
  • The web color name, e.g. “clWebLime”
  • The RGB value, e.g. “RGB(0, 255, 0)”

On top of that I moved the new menu items to a “Visualizers” submenu and added support to the “Local Variables” window as well.

These changes have already been committed to the svn repository on OSDN.

 Posted by on 2022-07-31 at 17:57

dzDebugVisualizer source code available

 Delphi, dzDebugVisualizer  Comments Off on dzDebugVisualizer source code available
Jul 312022
 

Several years ago I wrote a Delphi IDE plugin to extend the functionality of the “Evaluate and Modify” dialog as well as the Watches window called dzDebugVisualizer and even released an update for it. Back then I wasn’t sure whether I wanted to open source it or possibly commercialize it. I am now sure that the latter isn’t worth the effort, so I have made it open source under the Mozilla Public Licence 2.

You can find the source code on OSDN. And since I was at it, I also added support for Delphi 2009. To install it, get the source code, open the appropriate package, build and install it into the IDE.

For the description see the links to my old block posts.