Any #Shortcuts action dictates the name of its return value. For example, "Ask For Input" has a return value that is named "Provided Input”; if you use more than one instance of any action in your workflow, then all their return values will be named the same, which can be pretty confusing.
So I've made a quick video about how to rename those result values in your #macOS/ #iOS Shortcuts workflows:
I bloody hate hardware manufacturers. I wanted to use HDR on my PlayStation 5. The console supports it, my TV supports it, my amp supports it, my cables support it. Yet it wasn't working. I tried everything - updating firmware, replacing cables, and even reading the manual. Nothing. And then I stumbled on the answer […]
I bloody hate hardware manufacturers. I wanted to use HDR on my PlayStation 5. The console supports it, my TV supports it, my amp supports it, my cables support it. Yet it wasn't working. I tried everything - updating firmware, replacing cables, and even reading the manual. Nothing.
Perform the following procedure when the unit is on.
While pressing DIMMER on the main unit, press AUTO/DIRECT to display the current setting on the display. While this is being displayed, while pressing DIMMER on the main unit, repeatedly press AUTO/DIRECT to switch the setting.
To exit the settings, release your finger. After a few seconds, the display goes out and the switching is complete.
Once the setting was changed to "Enhanced" HDR worked! But why isn't it in the manual? A bit of searching for the text finds a file called manual/ .
So I assume that this is a supplement meant to update the original manual - it is mentioned as new functionality introduced after a firmware update. But why isn't it in the main manual?
If you visit the VSX-933 product page you can download the manual, but there's no mention of a supplement or an update. The original manual was released in 2018, and the supplement in 2019.
I wonder what other features this amp is hiding that Pioneer simply haven't bothered to tell anyone about?
🚀 I just published a short guide explaining how to upgrade PostgreSQL 🐘 from version 15 to 16 just after an upgrade to Ubuntu 24.04 LTS (Noble Numbat) 🦘
Bienenhotels: Für welche Arten taugen sie eigentlich? Es gibt einfache Möglichkeiten, Marke Eigenbau, spezialisierten Wildbienen im Garten oder auf dem Balkon etwas zu bieten 🐝
Hot on the heels of yesterday's post, I've now made all of this blog available in text-only mode. Simply append .txt to the URl of any page and you'll get back the contents in plain UTF-8 text. No formatting, no images (although you can see the alt text), no nothing! Front page https://shkspr.mobi/blog/.txt This blog […]
Hot on the heels of yesterday's post, I've now made all of this blog available in text-only mode.
Simply append .txt to the URl of any page and you'll get back the contents in plain UTF-8 text. No formatting, no images (although you can see the alt text), no nothing!
This was slightly tricky to get right! While there might be an easier way to do it, here's how I got it to work.
Firstly, when someone requests /whatever.txt, WordPress is going to 404 - because that page doesn't exist. So, my theme's functions.php, detects any URls which end in .txt and redirects it to a different template.
// Theme Switcheradd_filter( "template_include", "custom_theme_switch" );function custom_theme_switch( $template ) { // What was requested? $requested_url = $_SERVER["REQUEST_URI"]; // Check if the URL ends with .txt if ( substr( $requested_url, -4 ) === ".txt") { // Get the path to the custom template $custom_template = get_template_directory() . "/templates/txt-template.php"; // Check if the custom template exists if ( file_exists( $custom_template ) ) { return $custom_template; } } // Return the default template return $template;}
The txt-template.php file is more complex. It takes the requested URl, strips off the .txt, matches it against the WordPress rewrite rules, and then constructs the WP_Query which would have been run if the .txt wasn't there.
// Run the query for the URl requested$requested_url = $_SERVER['REQUEST_URI']; // This will be /whatever$blog_details = wp_parse_url( home_url() ); // Get the blog's domain to construct a full URl$query = get_query_for_url( $blog_details["scheme"] . "://" . $blog_details["host"] . substr( $requested_url, 0, -4 ));function get_query_for_url( $url ) { // Get all the rewrite rules global $wp_rewrite; // Get the WordPress site URL path $site_path = parse_url( get_site_url(), PHP_URL_PATH ) . "/"; // Parse the requested URL $url_parts = parse_url( $url ); // Remove the domain and site path from the URL // For example, change `https://example.com/blog/2024/04/test` to just `2024/04/test` $url_path = isset( $url_parts['path'] ) ? str_replace( $site_path, '', $url_parts['path'] ) : ''; // Match the URL against WordPress rewrite rules $rewrite_rules = $wp_rewrite->wp_rewrite_rules(); $matched_rule = false; foreach ( $rewrite_rules as $pattern => $query ) { if ( preg_match( "#^$pattern#", $url_path, $matches ) ) { $matched_rule = $query; break; } } // Replace each occurrence of $matches[N] with the corresponding value foreach ( $matches as $key => $value ) { $matched_rule = str_replace( "$matches[{$key}]", $value, $matched_rule ); } // Turn the query string into a WordPress query $query_params = array(); parse_str( parse_url( $matched_rule, PHP_URL_QUERY), $query_params ); // Construct a new WP_Query object using the extracted query parameters $query = new WP_Query($query_params); // Return the result of the query return $query;}
When you buy a TUXEDO, you don't just buy a laptop - we also provide a wide range of help articles and instructions that are constantly being updated and expanded.
One of the best HTTP clients is the open source tool curl. With ongoing development and continuously new updates, it is worth getting everything out of this powerful tool!
🆕 blog! “Server-Side Rendering of Embedded Markdown Code Snippets in WordPress”
Because I'm a grumpy old man, I don't use Gutenberg or Block themes on my WordPress. Instead, I write everything in Markdown. When I write code snippets in Markdown, they look like this: ```php $a = 1; echo $a; if ($a < 5) { // Do Something return thing( $a, true …
But I want to render that with code highlighting. I was using the Prismatic Plugin. It is excellent and very customisable. But it uses JavaScript to do the code highlighting. I want to respect my readers' time and battery life; so I'm trying to reduce my dependency on Client-Side rendering.
I've switched to a modified version of WP-GeSHi-Highlight. That turns the above Markdown into:
Secondly, in order to make any changes to the default styles of the highlighter, you need to add the bundled wp-geshi-highlight.css file into your style directory. The plugin will use that if it exists - so you can change font size and padding to be the same as your main theme.
No line-numbers. The plugin looks for something like line="13", but there's no way to add that in Markdown.
GeSHi hasn't received style updates on some languages for quite some time. It hasn't received any significant update since 2019. Which means bugs and security issues are likely.
Language definitions are quite strict. You can use javascript but not json.
The plugin doesn't have any options - nor an easy way to override its settings. So I've monkeypatched everything above. If the plugin updates, I'll need to change my code.
Rereading @pluralistic 's "Little Brother" last week brought back great memories of staying up way too late at night reading #USENET#HOWTO s and #FAQ s .. and then doing some sketchy shit with #linux