Random snippets of all sorts of code, mixed with a selection of help and advice.
Duplicate custom Order Action in WooCommerce
20 December 2025 @ 1:23 am
I have the following code on my site which sends a 'Ready to Collect' email to my customers, as well as updating the order status to ready to collect.
function custom_status_action( $actions ) {
unset($actions['send_osm_email_ready-to-collect']);
$actions['ns_fba_send_to_fulfillment'] = __( 'Send Ready to Collect custom email', 'woocommerce' );
return $actions;
}
add_action( 'woocommerce_order_actions', 'custom_status_action', 999 );
function ns_fba_send_to_fulfillment_process( $order ) {
$wc_emails = WC()->mailer()->get_emails();
if( empty( $wc_emails ) ) return;
$email_id = "wc_order_status_email_6181";
foreach ( $wc_emails as $wc_mail ) {
if ( $wc_mail->id == $email_id ) {
$wc_mail->trigger( $order->get_id() );
}
}
// update order status
$order->update_status( 'wc-ready' );
$order->save();
}
add_action( 'woocommerce_order_action_ns_fba_send_to_fulfillment', 'ns_f
How can I safely train or use an AI to automatically reply to personal WhatsApp messages?
20 December 2025 @ 12:59 am
I am studying Python automation and AI, and I would like to understand what is technically possible and safe when it comes to automating message replies on WhatsApp or whatsapp web .
My goal is not spam or commercial use. This is purely an educational and personal project.
Specifically, I would like to experiment with an AI that can help reply to normal, casual conversations, for example messages from my girlfriend, when I am busy.
What I am trying to understand:
Is it feasible to use WhatsApp Web automation (e.g. Selenium) combined with an AI model to read and reply to messages?
Is it better to train a small local model, or to use a pre-trained model (LLM) with prompts and limited context?
How can this be done while minimizing security and privacy risks, such as:
leaking personal conversations
exposing API keys
risking WhatsApp account bans
Are there best practices to make the automation behave more βhumanβ (
Android Subscription in MAUI BillingService
20 December 2025 @ 12:55 am
I like to use the implementation for the BillingService from the Microsoft GitHub. I have a question about the Android implementation.
When the procedure reads the BillingClient.ProductType.Inapp, the list of products from the store is fine. In the Google Play Console, to define a subscription, there are 2 steps. In the first one, I define the name and Id of the subscription.
And then, I can define one or more plans.
When the query is built in the function
And then, I can define one or more plans.
When the query is built in the function How to get Terraform value into Spring Boot application?
20 December 2025 @ 12:47 am
I build my project using Buildkite, one of the steps is to create the AWS infra using Terraform. Then helm is used to deploy the application to EKS. I'm wondering how to get a value from Terraform (in this case the cache address) into an env var (or something else) that the Spring Boot application can access and load.
Why Aren't JoinSets with recursive calls `Send`?
20 December 2025 @ 12:43 am
use tokio::task::JoinSet;
async fn massively_parallel_fib(n: u64) -> u64 {
if n == 0 {
0
} else if n <= 2 {
1
} else {
let mut set = JoinSet::new();
set.spawn(async move { massively_parallel_fib(n - 1).await });
set.spawn(async move { massively_parallel_fib(n - 2).await });
set.join_all().await.into_iter().sum()
}
}
#[tokio::main]
async fn main() {
let i = 4;
let start = std::time::Instant::now();
let n = massively_parallel_fib(i).await;
println!("computed fib({i}) = {n} in {:?}", start.elapsed());
}
playground link
This fails to compile, complaining that massively_parallel_fib is not Send. Why isn't it? It doesn't hold anything except f
Mamba.__init__() got an unexpected keyword argument 'bimamba_type'
20 December 2025 @ 12:37 am
I am working on building a mamba model in google Collab but I am struggling with some installations. I checked the github issue and I still couldn't fix it π . The error I have is Mamba.init() got an unexpected keyword argument 'bimamba_type' I tried installing from the github repisotory but I get this error:
1. Installing mamba from Vim repository...
Obtaining file:///content/Vim/mamba-1p1p1
error: subprocess-exited-with-error
Γ python setup.py egg_info did not run successfully.
β exit code: 1
β°β\> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Preparing metadata (setup.py) ... error
error: metadata-generation-failed
Γ Encountered error while generating package metadata.
β°β\> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for detai
Cannot install Tensorflow GPU on Win 11
19 December 2025 @ 11:42 pm
i was training AI in my pc using tensorflow with CPU due i have a amd GPU, well i bought a Nvidia RTX 5060 TI 16GB and i couldn't make it work.
First, i made a new environment with anaconda, installed tensorflow, matplolib, opencv, notebook, numpy normally, also installed cudatoolkit and cundnn (acording to copilot this necessary in order to training with the GPU), well the thing is when i started the training it was slow, and in the task manager i could see that the GPU wasn't being used, it was using CPU as before.
I ran the command nvidia-smi command and the driver shows the GPU, with in the environment tensor flow doesn't do it, i keep trying to make it work and i ended that tensorflow last version wasn't supported in windows so i followed some instructions to use the ubuntu console and WSL, and still didn't work.
My hardware is: Ryzen 7 5700x, 32GB RAM 3200, RTX 5060 TI 16GB, NVME Gen3 1TB, Windows 11 23h2, Python 3.10
Some errors i get:
Firefox version 146 on Mac Catalina 10.15.7 (19H2026 hangs my entire system
19 December 2025 @ 6:24 am
Has anyone experienced problems with the most recent release of Firefox (146). I'm on a Mac using Catalina and the latest Firefox update makes my computer basically unusable.
x-modelable not working inside React component [closed]
17 December 2025 @ 7:42 pm
I am building a documentation page in MDX and I have a component that initializes a new Alpine tree. For some reason the exact example for x-modelable found in the Alpine documentation is not working. The internal count is updated but the outer number never updates. Why is this not working?
Component Usage:
<AlpinePreview
html={`
<div x-data="{ number: 5 }">
<div x-data="{ count: 0 }" x-modelable="count" x-model="number">
<button @click="count++">Increment</button>
</div>
Number: <span x-text="number"></span>
</div>
`.trim()}
/>
Component Definition:
export function AlpinePreview({ html }: { html: stri
How to create a Straddling div that overlaps direct sibling div, but does not overlap content
8 December 2025 @ 7:36 am
I want to add a "Straddling div", between two other divs in a column layout.
Div 1, Div 2, Div 3.
Diagram:
In the above image, scenario on the left, Div1 and Div2 are 'touching'. Just two divs next to each other in the DOM, and they each have internal padding.
In the second scenario, on the right, I want to have a straddling div, that doesn't change that the Div1 and Div3 should be 'touching', but I want to make sure the padding remains consistent, so the content is not being overlapped by the straddling div.
Attempts in this fiddle with CSS selectors, but there are magic numbers that I don't really want, and it didn't get me the solution I wanted anyway.
Is there some nice trick to doing this? Ideally with no magic
In the above image, scenario on the left, Div1 and Div2 are 'touching'. Just two divs next to each other in the DOM, and they each have internal padding.
In the second scenario, on the right, I want to have a straddling div, that doesn't change that the Div1 and Div3 should be 'touching', but I want to make sure the padding remains consistent, so the content is not being overlapped by the straddling div.
Attempts in this fiddle with CSS selectors, but there are magic numbers that I don't really want, and it didn't get me the solution I wanted anyway.
Is there some nice trick to doing this? Ideally with no magic