Nice article about the inputmode attribute

I wasn’t aware of the inputmode-attribute for input or textarea elements in HTML, but this excellent article on CSS-Tricks opened up a new world.

<input type=”text” inputmode=”numeric”>
on an Android device

Ensure your mobile users have a good experience by using inputmode rather than <input type="number" ...> etc. inputmode="numeric" can be used with maxlengthminlength and pattern attributes and therefore allows for a more controlled input.

Note: you probably want to add your own validation checks, as the browser will not do any validation with <input type="text" ...>.

How to ignore @ errors in a custom PHP error handler

In my PHP pages, I’m using a custom error handler, to make potential errors a bit more user-friendly. However, in some very particular cases, I don’t want an error to be raised (e.g. I’m logging all errors to a server file, but if writing to that file does not work for whatever reason, I don’t want to bother the user with it). In those cases, I’m using the @ error-control operator to ignore any error:
@error_log($error_trace.' ['.str_replace("\n",'\n',$error_message).'] ['.str_replace("\n",'\n',$error_data)."]\n",3,ERROR_LOG);

The @ error-control operator, However, even with @, the custom error handler is still triggered.

Thanks to this blog post I learned that error_reporting is 0 if the statement that caused the error was prepended by the @ error-control operator. So the solution is to add:
if (error_reporting() === 0) {
// continue script execution, skipping standard PHP error handler  (e.g.when using @ in front of an expression)
return true;
}

to the custom error handler

Update to removing annoying context menu items

Time for an update of the various things you need to do to remove annoying context menu items:

3D Print with 3D Builder context

  • regedit: remove subkeys
    HKEY_CLASSES_ROOT\SystemFileAssociations\.bmp\Shell\T3DPrint
    HKEY_CLASSES_ROOT\SystemFileAssociations\.jpg\Shell\T3DPrint
    HKEY_CLASSES_ROOT\SystemFileAssociations\.png\Shell\T3DPrint

Edit with Photos

  • regedit: add
    HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellEdit > New String Value = ProgrammaticAccessOnly

Cast to Device (*)

  • regedit: add
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked > New String Value = {7AD84985-87B4-4a16-BE58-8B72A5B390F7}

Share

  • regedit: remove subkeys from
    HKEY_Classes_ROOT\*\shellex\ContextMenuHandlers\ and
    HKEY_CLASSES_ROOT\Directory\shellex and
    HKEY_CLASSES_ROOT\Folder\shellex
    • Adobe.Acrobat.ContextMenu
    • DropboxExt
    • Modern Sharing
    • PicaViewCtxMenuShlExt
    • Sharing
    • SnagItMainShellExt
    • TeraCopy