I’ve been having some hard time writing this and I searched a lot for any similar questions but didn’t find any. So I have this Schema: And I want to automatically delete the channel after x time of its creation, the Time is saved as <channel>.createdTimestamp And here is the condition of th…
Tag: javascript
Regular Expression to find a group of strings between two characters
Lets say I have: The aim is to get: I want to achieve this with RegEx. When I try (?<=–)(.*?)(?=, US) I can’t seem to get the second group of ‘–‘ out. Answer You can use the lookbehind, but in between you should not match — again Regex demo You can also use a capture gro…
Modal Collector Discord.js
I was trying to create a collector for my modal using Discord.js. With the code below I don’t get an error, but the modal fails in Discord and the code in collector.on never runs. I have used a similar approach to be able to create a button collector by replaycing the compententType: with “BUTTON&…
How should a user be redirected to another page after successful login in Vue 3
In a vue 3 application that uses composition api, I want to do one of 2 things based on if an authenticated user is verified or not. So if the user is not verified, send the user to the verification page. But if the user is verified, send the user to the dashboard. To achieve this, I am using navigation
I want my to – do app to put a line through on each task when the complete button is pressed
I have created a function that completes a task when the user clicks the complete button, however, I am using a for loop to loop through the array so that it can mark it off. Currently, what it is doing no matter what complete button I press, it marks off only the first task and not the one I want.
Google Consent Mode Implementation using Gatsby
I am following this tutorial about implementing google consent mode to add cookies to my website ! By using Gatsby.js I am not sure how to add these codes : Do you have any idea how to implement this code in Gatsby , is there any library or something that will help to implement these scripts ! Thanks Answer T…
Input tag validation
I have just an input tag with the following logic: https://codepen.io/ion-ciorba/pen/MWVWpmR I have a minimum value coming from the database(400 in this case), the logic is good but the user interaction with the component is really bad, the user can’t input a value that is below 400, I want something el…
concatenation state in useEffect cause loop
i had read some questions and article about this issue including this one: but i don’t find my answer. consider this code. i have a pagination and every time i go to next page i need to concatenate the data with previous one, here is the deal. the react complains about dependency array about list and pa…
Vue 3 Composition API ref primitive property not reactive
So while building a tab system I’m taking advantage of useSlots and props in order to create an array of titles (these are the titles of every tab that I open in my tab system), then I create a ref property called selectedTitle in order to bind that title to a class and add css to highlight the tab sele…
All my operators work as an add operator in my calculator
So basically when I want to subtract, it adds numbers. When I wrote the same code for multiply and divide, it did the same thing. Instead of dividing, it was adding numbers etc. I have no idea why it’s happening. It’s like my javascript ignores dataset.action and treats operators like one button. …