Random snippets of all sorts of code, mixed with a selection of help and advice.
Polylang - main page does not get translated
8 April 2026 @ 7:56 am
I'm using Polylang plugin for Wordpress to support translation. My main page consists of list of posts and I have two separate categories for two languages that my site supports ("Strona główna", "Main Page"). Both are turned on as sources for the main page post list. When Polish language is selected, main page correctly shows list of Polish posts. I'm also using Donovan theme, if that's relevant.
After updating the Polylang plugin to the newest version, my website started falling into an infinite redirect loop. I have resolved the issue by turning off automatic detection of browser language and hiding default language in the URL. The loop looked like following (the default language is Polish):
https://site/en -> https://site -> https://site/en -> ...
The infinite loop is now resolved, however when switching the language to English, i
Type narrowing is working with [] operator and not with Array.at
8 April 2026 @ 7:52 am
First, playground
https://www.typescriptlang.org/play/?target=99&ts=6.0.2#code/C4TwDgpgBAMglgZ2ASWBAtlAvFA3gKCigEMAuKJAJzgDsBzQqAI3JoFd0mJL8BfffAHpBoSFAAKlAPZgE2WIhRp0AbQC6UAD4KkqDOvX5R0STLk4AgpUrEQAHni7lAPi1QrN+x9sPFe9M7OAgBmbDQAxsBwUjRQaEhQABRgxDbo5KayAJR4jHDBiQDkxIVQtFApaSoADGo5BERE4TEJcMrkjkoY8pXEqrWM-IzNNAnBcJROGADykDbAUpQdfspu3vad-q44vf1qwy3AUOOTXegWwMtTmNrrvteu2mEAJhDjNBDPPal9AHTEwES1SyAiI+US61+iHWyR+eyy9UYTUOZXaOjO6m+VQGRCGYIKkOh1lssLS-0BwIRu
Secure HttpOnly cookie not set in production environment
8 April 2026 @ 7:45 am
I developed a JWT based authentication that sends tokens in httpOnly, secure cookies. Here is the response of my login request:
access-control-allow-credentials
true
access-control-allow-headers
Content-Type, Authorization, X-Requested-With
access-control-allow-methods
GET, POST, PUT, DELETE, OPTIONS
access-control-allow-origin
https://mysite.example.com
access-control-max-age
3600
date
Wed, 08 Apr 2026 07:29:36 GMT
server
nginx
set-cookie
access-token=********; expires=Thu, 09 Apr 2026 00:00:00 GMT; httponly; secure; samesite=None; path=/; domain=.example.com
set-cookie
refresh-token=********; expires=Wed, 15 Apr 2026 00:00:00 GMT; httponly; secure; samesite=None; path=/; domain=.example.com
My issue is that the cookies are not set when i go to Application > Cookies only when I'm running in production.
If I'm running the app in dev (localhost:5173), everything works fine and cookies are set.
I've already tri
How to replace Twilio with a local SIP/PBX setup for an AI Voice Bot in Pakistan?
8 April 2026 @ 7:44 am
I have built a voice-to-voice bot using Python (FastAPI) and Twilio. The orchestration logic handles the STT, LLM, and TTS flow. Currently, I am using a Twilio virtual number, and it works fine for testing.
However, I need to deploy this bot for a hospital in Pakistan using a local landline or mobile number (e.g., 051-xxxxxxx or a mobile series). Twilio does not currently offer local inbound numbers for Pakistan that support programmable voice.
Current Stack:
Logic: Python (FastAPI/WebSockets)
AI: Gemini Live / Custom RAG
Telephony: Twilio (Current)
The Problem: I need a "bridge" that can accept a call from a local Pakistani carrier (like PTCL or Nayatel) and pass the audio stream to my Python logic, similar to how Twilio’s Webhooks or Str
How can I structure a C library project that uses Make with an examples subdirectory containing multiple examples?
8 April 2026 @ 7:39 am
I'm currently trying to sharpen my skills in C (as C++ is my "daily driver") by working on a small library project. The current project structure follows as described below:
project/
├─ bin/
│ ├─ libproject.a
├─ include/
├─ src/
├─ Makefile
And here is the current top-level Makefile:
SRC_DIR := src
OBJ_DIR := obj
BIN_DIR := bin
LIB_DIR := lib
EXE := $(BIN_DIR)/libproject.a
SRC := $(wildcard $(SRC_DIR)/*.c)
OBJ := $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
CPPFLAGS := -Iinclude -MMD -MP
CFLAGS := -Wall
LDFLAGS := -L$(LIB_DIR)
LDLIBS := -lm
.PHONY: all clean
all: $(EXE)
$(EXE): $(OBJ) | $(BIN_DIR)
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
$(BIN_DIR) $(OBJ_DIR):
mkdir -p $@
clean:
@$(RM) -rv $(BIN_DIR) $(OBJ_DIR)
-include $(OBJ:.o=.d)
As you can
Jwt Authentication using access token and refresh token problem
8 April 2026 @ 7:34 am
My question is if we are using JWT auth for authentication, then where should i put my access token for calling APIs quickly so that my application feels fast as compare to other and also there is one more doubt, i study jwt authentication from yt and there is a person said that your refresh token should be hash in http only cookie so that if attackers attack on your resources they can not access anything so now my question is if the hash refresh token is too good to store in http only cookie so why not access token and also if i am sending the access token in response so is there any problem with that.
BTW i am using Node.js for backend
Google haritalar foto partneri olmak istiyorum
8 April 2026 @ 7:28 am
Sn.Yetkililer, google haritalarda sokak mekan yer fotoğraf partneri olmak ve bu işten para kazanmak istiyorum. Nasıl bir yol izlemem lazım kendi aracım var onunla neler yapabilirim. Bana bu konularda ne tavsiye edersiniz.
WhatsApp Coexistence Embedded Signup - Cannot select own business portfolio as Tech Provider
8 April 2026 @ 7:23 am
Problem
I am a registered WhatsApp Tech Provider and I'm trying to onboard my own business phone number using the Coexistence feature (WhatsApp Business App onboarding via Embedded Signup).
During the Embedded Signup flow, when I reach the business portfolio selection screen, my own portfolio is grayed out with the message:
"This business portfolio owns Developer APP. You can only select other business portfolios."
This means I cannot select the portfolio that owns my app to onboard my own production WhatsApp Business App number.
What I've tried
Selecting other business portfolios — these belong to other businesses and I don't want to use them
Looking for a pure API approach to trigger Coexistence without Embedded Signup — doesn't seem possible since the WBA ↔ Cloud API linking requires the Embedded Signup UI flow
Cannot filter by spatial extent a GTFS (gtfstools)
8 April 2026 @ 7:23 am
I'm trying to build a single GTFS for Milan by merging several GTFS from different transport companies operating in the province of Milan. However, before merging, I need to filter spatially only for the portion of public transport that deals with the Milan area (some companies also operate in other provinces). I keep getting an sfheaders error when I try to filter the GTFS of the Milan municipality transport company (ATM). I cannot understand where the error is since the shapes file of the GTFS seems correct to me.
# Dictionary: name -> zip filename
gtfs_files <- list(
atm = "gtfs.zip",
trenord = "trenord_gtfs.zip",
movibus = "2026-03-06_Movibus.zip",
stav = "2026-01-30_STAV.zip",
airpullman = "2025-09-25_Airpullman.zip",
star = "2025-07-29_STAR.zip"
)
gtfs_list <- lapply(gtfs_files, function(filename) {
path <- file.path(gtfs
Js practice places for free
8 April 2026 @ 7:16 am
Can any one tell me as a beginner in js is there are any sites or something to test my knowledge in js, html, css for free.
I really wanna do that. Cause it's really a big problem for me to remember or memories what I've studied (any language).
Can anyone help me with this.