dnc, to HowTo
@dnc@vive.im avatar
screwtape, to fediverse
@screwtape@mastodon.sdf.org avatar

Breaking up my failures-to-build with my discovery of using

I really like this eight minute if I do say so myself.

https://toobnix.org/w/2WYHBTHGvRQ8pUSVmKhKGg

@adanskana @sachac @louis
can I ask for some opinions on the clim / emacs / lisp useage as conveyed by videos?

This is pretty much just what I really do when near a computer for eight minutes.
Playlist:
https://toobnix.org/w/p/4bRcULzg6bBAyELkRqU6EQ?playlistPosition=1

outofcontrol, to mastodon
@outofcontrol@phpc.social avatar

Possibly naïve question… can we embed a Mastodon post into a site, like others can do with X?

#x

czottmann, (edited ) to Shortcuts
@czottmann@norden.social avatar

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:

https://forum.actions.work/t/how-to-tell-your-action-results-apart-by-naming-them/385

#ShortcutsApp #HowTo

Edent, to HowTo
@Edent@mastodon.social avatar

🆕 blog! “HDR on a Pioneer VSX-933”

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 […]

👀 Read more: https://shkspr.mobi/blog/2024/05/hdr-on-a-pioneer-vsx-933/

blog, to HowTo
@blog@shkspr.mobi avatar

HDR on a Pioneer VSX-933
https://shkspr.mobi/blog/2024/05/hdr-on-a-pioneer-vsx-933/

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 thanks to a random forum post.

Perform the following procedure when the unit is on.

  1. 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.
  2. 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?

https://shkspr.mobi/blog/2024/05/hdr-on-a-pioneer-vsx-933/

paulox, to ubuntu
@paulox@fosstodon.org avatar

🚀 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) 🦘

#Ubuntu #NobleNumbat #Noble #Numbat #LTS #PostgreSQL #Postgres #HowTo #Upgrade

Read it 👇
https://www.paulox.net/2024/05/20/upgrading-postgresql-from-version-15-to-16-on-ubuntu-24-04-noble-numbat/

3sat, to HowTo German
@3sat@zdf.social avatar
Taffer, to HowTo
@Taffer@mastodon.gamedev.place avatar

New post - Linux Roundup https://taffer.ca/posts/2024/linux-roundup/

A description of various Linux distros that I’ve used, which might help someone else pick one.

tallship, to foss
@tallship@stella.place avatar

Here's a short, simple, and straightforward guide to installing the Mitra Fediverse Server.

I hope that helps :)

Enjoy!

.

WetHat, to HowTo
@WetHat@fosstodon.org avatar

Advanced C# Tricks for Developers 🔥 | Medium

Ten methods to boost code efficiency and readability for experienced developers.

https://medium.com/@kmorpex/10-advanced-c-tricks-for-experienced-developers-26a48c6a8c9c

Edent, to HowTo
@Edent@mastodon.social avatar

🆕 blog! “link rel="alternate" type="text/plain"”

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 […]

👀 Read more: https://shkspr.mobi/blog/2024/05/link-relalternate-typetext-plain/

#HowTo #php #WordPress

blog, to HowTo
@blog@shkspr.mobi avatar

link rel="alternate" type="text/plain"
https://shkspr.mobi/blog/2024/05/link-relalternate-typetext-plain/

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;}

From there, it's a case of iterating over the posts returned by the query. You can see the full code on my GitLab.

https://shkspr.mobi/blog/2024/05/link-relalternate-typetext-plain/

CppCon, to HowTo
@CppCon@mastodon.social avatar

We have released a new CppCon 2023 Video!

Lightning Talk: Writing a Better std::move – by @foonathan- CppCon 2023
https://youtu.be/hvnl6T2MnUk

GregCocks, to Battlemaps
@GregCocks@techhub.social avatar
Taffer, to HowTo
@Taffer@mastodon.gamedev.place avatar

New post - Auto-deploy: Hugo and Codeberg CI https://taffer.ca/posts/2024/hugo-ci/

A description of how I’ve set up Codeberg’s CI to automatically build and deploy changes to my website.
#Codeberg #Git #Howto #Hugo #Tools

tuxedocomputers, to legal German
@tuxedocomputers@linuxrocks.online avatar

Collection of instructions

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.

Just take a look!
https://www.tuxedocomputers.com/en/Infos/Help-and-Support/Instructions.tuxedo

mboelen, to HowTo
@mboelen@mastodon.social avatar

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!

https://linux-audit.com/cheat-sheets/curl/

And as a bonus: @bagder is friendly developer, and also great to follow here on Mastodon! So give the article a go and follow Daniel 😉

This is the first version of the cheat sheet, with some practical examples. Feedback is very welcome, and boosts as well 🚀

Taffer, to HowTo
@Taffer@mastodon.gamedev.place avatar

New post - Backups https://taffer.ca/posts/2024/backups/

Please back up your files (and a how-to for restic on Linux)!

Edent, to HowTo
@Edent@mastodon.social avatar

🆕 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 …

👀 Read more: https://shkspr.mobi/blog/2024/04/server-side-rendering-of-embedded-markdown-code-snippets/

#HowTo #php #programming #WordPress

blog, to python
@blog@shkspr.mobi avatar

Server-Side Rendering of Embedded Markdown Code Snippets in WordPress
https://shkspr.mobi/blog/2024/04/server-side-rendering-of-embedded-markdown-code-snippets/

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:

$a = 1;echo $a;if ($a < 5) {   // Do Something   return thing( $a, true );}

Necessary Changes

When the JetPack Markdown pre-processor encounters a code block, it changes:

```php

into

<code class="language-php">

This means the WP-GeSHi-Highlight detection needs to be changed.

Old version:

return preg_replace_callback(    "/s*".    "(.*)</pre>s*/siU",   "wp_geshi_store_and_substitute",   $s);

New version:

return preg_replace_callback(    "/s*".    "(.*)</code>s*/siU",   "wp_geshi_store_and_substitute",   $s);

One of those matches looks for escaped= which can be true or false. I always want this to be true so, later in the code, I change a variable from:

$escaped = trim($match[3]);

To:

$escaped = true;

Style Changes

By default, everything looks pretty good - but there are a few changes I found necessary to make.

Firstly, there was something weird going on with the line-heights of my style, so I added this to my site's CSS:

/* GeSHI Highlighter Fixes */pre:has(> .wp-geshi-highlight-wrap5) {    line-height: 0;    padding: 0;    background: none;    filter: invert(1);}

The invert gives it a dark mode.

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.

Limitations

There are a few limitations with this approach.

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.

Demos

A few demos - just so you can see what it looks like.

Python

#!/usr/bin/env pythonfrom datetime import datetime, timedeltafrom mastodon import Mastodonfrom bs4 import BeautifulSoupimport config#  Set up accessmastodon = Mastodon( api_base_url=config.instance, access_token=config.access_token )#  Get user's infome = mastodon.me()my_id = me["id"]year_joined = me["created_at"].year

Bash

if [ "$(basename $2)" = "Image.gz" ] || [ "$(basename $2)" = "vmlinuz.efi" ]then# Compressed install  echo "Installing compressed kernel"  base=vmlinuzelse# Normal install  echo "Installing normal kernel"  base=vmlinuxfiif [ -f $4/$base-$1 ]; then  mv $4/$base-$1 $4/$base-$1.oldfi

Rust

// This is the main function.fn main() {    // Print text to the console.    println!("Hello World!");}

JavaScript

if (hour < 18) {  greeting = "Good day";  alert( greeting );} 

https://shkspr.mobi/blog/2024/04/server-side-rendering-of-embedded-markdown-code-snippets/

#HowTo #php #programming #WordPress

Taffer, to HowTo
@Taffer@mastodon.gamedev.place avatar

New post - Touchpad vs Mouse - KDE on Wayland https://taffer.ca/posts/2024/touchpad-vs-mouse/

I figured out a way to automatically enable or disable my laptop touchpad when my mouse is disconnected or connected!

sergio_101, to usenet
@sergio_101@mastodon.social avatar

Rereading @pluralistic 's "Little Brother" last week brought back great memories of staying up way too late at night reading s and s .. and then doing some sketchy shit with

aral, to SmallWeb
@aral@mastodon.ar.al avatar
otyugh, to HowTo French
@otyugh@pouet.chapril.org avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • thenastyranch
  • magazineikmin
  • cubers
  • GTA5RPClips
  • mdbf
  • rosin
  • Youngstown
  • slotface
  • ngwrru68w68
  • InstantRegret
  • kavyap
  • khanakhh
  • DreamBathrooms
  • megavids
  • osvaldo12
  • cisconetworking
  • Leos
  • Durango
  • love
  • everett
  • modclub
  • tacticalgear
  • tester
  • provamag3
  • ethstaker
  • normalnudes
  • JUstTest
  • All magazines