Random snippets of all sorts of code, mixed with a selection of help and advice.
AWS Lightsail node.js blueprint + nginx conf file editing
14 June 2026 @ 1:31 am
A few years ago on the Bitnami Node.js servers at AWS Lightsail I would set up an instance to forward traffic from port 80 to port 3000 by rewriting the 'etc/nginx/sites-enabled/defualt' configuration file.
The process was something like
sudo rm etc/nginx/sites-enabled/default
sudo nano etc/nginx/sites-available/myConfFile
New Configuration File
server {
listen 80;
server_name tutorial;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:3000;
}
}
Link the new file to 'sites-enabled'
sudo ln -s /etc/nginx/sites-available/myConfFile /etc/nginx/sites-enabled/myConfFile
and restart nginx
sudo service nginx restart
So I could call the Node.js app from php file from a web server explicitly without using Port:3000 "http://nodejs2.example.com:3000&q
What is the difference between Rust memory safety and Ada type safety?
14 June 2026 @ 1:29 am
Rust provides strong memory safety guarantees. Ada provides type safety. Rust numeric types are structural, based on machine memory layouts. Ada numeric types are nominative and are defined by an explicit valid data set.
Intentionally warn typescript compiler with inline flag/preprocessor
14 June 2026 @ 12:55 am
Is there a similar syntax to //@ts-ignore, with the effect of creating a compiler warning at that location? If not natively in the typescript transpiler, are there preprocessors/tools that could do this or something similar?
I occasionally push debug code on accident, I normally use console warnings at runtime to remind me to change X back to Y. Having a preprocessor warn me or be able to strip debug symbols out with a production flag, similar to #ifdef in c++, would be nice.
//@ts-warn('remove before publish')
console.log(wtv);
//@ifdef DEVELOPMENT
example();
//@endif
I'm also not opposed to making a tool myself, what should I look into for making something like that?
Testing SoundTouchJS with Web Audio API, sanity check, failing test
14 June 2026 @ 12:54 am
Im following the README here: https://github.com/cutterbl/SoundTouchJS/tree/master/packages/formant-correction-worklet
I created a test case as a sanity check:
Testing = {
defineTestProcessor: async function(audioBuffer){
var sourceNode = new AudioBufferSourceNode(Audiodata.context, {
buffer: audioBuffer
})
var blob = new Blob([AudioProcess],
{type: "application/javascript" })
var processorBlobURL = URL.createObjectURL(blob)
await Component.nodes.FormantCorrectionNode.register(Audiodata.context, processorBlobURL)
var node = new Component.nodes.FormantCorrectionNode({
context: Audiodata.context
})
node.pitchSemitones.value = 7
node.formantStrength.value = 1
node.connect(Audiodata.co
Why does my BigQuery query return NULL for AVG() when the column has values?
14 June 2026 @ 12:37 am
Problem details:
I'm working with a weather dataset in BigQuery and trying to calculate the average temperature for a specific date range. The temperature column contains numeric values, but my AVG() query keeps returning NULL instead of a number. I've confirmed the table has data in that range when I run a basic SELECT.
What I tried/expected vs. actual:
I expected AVG() to return the mean temperature across the filtered rows. Instead, it returns NULL.
Here's my query:
SELECT AVG(temperature)
FROM `my_project.demos.nyc_weather`
WHERE date BETWEEN '2020-06-01' AND '2020-06-30'
I suspect it may be related to how missing values (stored as 9999.9 in the source) were handled, or a data type issue with the temperature column, but I'm not sure how to confirm or fix it.
Tags: sql, google-bigquery, aggregate-functions, null,
I want to run Forge Neo on Google Colabratoly
13 June 2026 @ 11:27 pm
!pip install -U protobuf
!pip uninstall -y tensorflow tensorflow-cpu tensorflow-gpu tf-keras
!pip install -U "protobuf\>=5.28.0"
!pip install gradio-rangeslider
%cd /content/sd-webui-forge-neo
!python launch.py --share
I tried to install forge-neo using the syntax above to run ZIT on Colab, but I’m getting the error below and can’t generate images.
When I asked ChatGPT, it told me to check if “ControlNet’s Resize / Processor Resolution” is set to -1, but that option isn’t even showing up due to the error. I’ve tried everything I can to get it working, but it’s become a never-ending cycle. Please help.
Traceback (most recent call last):
File "/usr/local/lib/python3.12/dist-packages/gradio/routes.py", line 1298, in predict
output = await route_utils.call_process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File &
Struggling to understand how to have some text inside an unordered list bold
13 June 2026 @ 10:56 pm
A simple example of my unordered list that seems to render but breaks the rules:
<ul>My household pets
<li>There is a fluffy <b>cat</b></li>
<li> The <b>dog</b> is small</li>
<li> The <span class="something">Mongolian Gerbil</span> is cute</li>
</ul>
In this simple example how would I have the animals using bold, while the rest of the text stays normal? Let me add that I also want to use <span> for some text formatting instead of the <b> tag and I'm hoping that the same solution (if it exists) works for both. Thank you.
ORA-01858 when doing BULK COLLECT INTO a PL/SQL record type with JSON_TRANSFORM on VARCHAR2 JSON columns
13 June 2026 @ 7:30 pm
ORA-01858 when using JSON_TRANSFORM in BULK COLLECT INTO a PL/SQL record type
I have a PL/SQL procedure that does a BULK COLLECT INTO a collection of a custom record type. Two of the fields in the record type are VARCHAR2 columns that store JSON. When I include JSON_TRANSFORM on those columns in the SELECT, I get ORA-01858.
Error:
ORA-20011: *** Error **** While executing sp_process @ Insert into
MY_POLICY_TABLE. Error Details - ORA-01858: a non-numeric character
was found where a numeric was expected ORA-06512: at
"MY_SCHEMA.MY_PACKAGE", line 4151
Record type and collection definition:
TYPE rec_my_policy IS RECORD (
MY_KEY MY_POLICY_TABLE.MY_KEY%TYPE
, MY_REF_ID MY_POLICY_TABLE.MY_REF_ID%TYPE
, START_DATE MY_POLICY_TABLE.START_DATE%TYPE
, END_DATE MY_POLICY_TABLE.END_DATE%TYPE
, CHANGE_
In Asio, how to resume async_read / async_write after cancellation?
13 June 2026 @ 11:37 am
Asio cancels other awaitables when one branch of awaitable<>::operator|| finishes. Cancelling async_read / async_write may lose data. How to save the read/write progess on cancellation and resume afterward? e.g. How to implement a custom cancellation_type::partial async_read using async_read_some, and async_write using async_write_some? Asio version is 1.38.0
#include <asio.hpp>
#include <asio/experimental/awaitable_operators.hpp>
#include <assert.h>
#include <iostream>
#include <stdio.h>
using asio::as_tuple_t;
using asio::awaitable;
using asio::buffer;
using asio::co_spawn;
using asio::detached;
using asio::io_context;
using asio::steady_timer;
using asio::ip::tcp;
using namespace asio::experimental::awaitable_operators;
using std::chrono::steady_clock;
using namespace std::literals::chrono_literals;
using asio::use_awaitable_t;
using default_token = as_tuple_t<use_awaitable_t&
RevenueCat offerings empty — StoreKit returns no products for READY_TO_SUBMIT subscription on both simulator and real device (Flutter/iOS)
13 June 2026 @ 6:50 am
I'm integrating RevenueCat into a Flutter iOS app. Offerings always fail to load regardless of whether I test on simulator or a real device. StoreKit receives a response but returns no products.
Environment:
purchases_flutter: ^10.2.2 (RC SDK 5.76.0)
Flutter 3.x, iOS target
Product ID: my_product (auto-renewable monthly subscription)
App Store Connect status: READY_TO_SUBMIT
RC dashboard: default offering configured, my_product mapped to my_product entitlement
Error:
No existing products cached, starting store products request for: ["my_product"]
Store products request received response
Store products request finished
Error fetching offerings - The operation couldn't be completed.
(RevenueCat.OfferingsManager.Error error 1.)
There's a problem with y