Skip to content

Translate JS into math (multiple variables defined)

I have this code I am trying to translate into maths My basic problem is that the var ‘top’ is declared 3 times, so I don’t know how to reflect it mathematically. var bottom is also declared twice, which value will be the final? the first variable or the second? Answer JavaScript is imperati…

Regex for numbers with spaces and + sign in front

If i want to accept only numbers then i will use this regex but the problem here is that the numbers like +1 00 are not catched and my regex will show that it is invalid The user needs to type only numbers but only one space in between is allowed and + sign at the beggining should be optional.

Electron, contextIsolation and contextBridge

I recently had to revamp an old Electron app. I found out that it had contextIsolation set to false, so I went ahead and set it to true (and btw set nodeIntegration to false). As expected, it broke the ipc communications So I used, as advised in many places, a preload script that enables some communications c…

Change language in Roomle Configurator

I use the following code to instantiate the Roomle Configurator on my website: By default the configurator always uses the default browser language. Is it possible to change that? Answer It’s possible to use the locale url param to set the language. Here is a list with all available languages: https://w…