I need to understand and find a way to replace the occurences of placeholders in a string. I’m working on an app for the Magic, The Gathering tcg game. The text of the card contains a description and some symbols Let me explain better with an example: Some possible strings are “{W}{B}, {T}: Preven…
Tag: javascript
How to get a “fido-u2f’ attestation fromat
I tried to create a basic webauthn implementation, using the “Web Authentication API” to use user’s biometric. There’s one thing I don’t get and I didn’t find the answer online, it is: Why do I get an attestation with a format set to ‘packed’ by default instead …
Detecting mismatch where there are multiple occurences of array elements in more than one array
I have the following arrays: So I want to display a list of recordIds where we don’t have an equal number of records in either array for given recordId. e.g In above example recordId:123 has 3 x records in primary array but only 2 x in the secondary array, therefore because the number of records donR…
Make a div smaller when scrolling
Hi i tried to make the div smaller wqhen scrolling. however i found some article that the div is small then when scroll it make bigger. i wanted the opposite. when run the image is 100% then when scroll it will be smaller. can someone help me please? i am new to this This is the code: https://codesandbox.io/s…
How to block user from accessing other tabs in Shiny unless the user clicks a button?
My question is similar to Shiny how to block the user from accessing a tab? But what I need here is: -Block other tabs unless the user clicks on a submit button -Automatically move to the other tab once that submit button is clicked. Here is an example code In the above code, the 2nd tab is blocked unless the
Insert each div inside next div (jQuery)
How can I insert div.one into his next div.two with jquery? What it is: What I want: What I tried (but it insert all div.one in every div.two): Whats my fail? Answer You were close: using the class in the preprendTo() function will of course select all the .box.two elements, instead by doing $(this).next() we…
change the background video of the website according to the weather
There was a problem with the above. I want a dynamic video background for a website. It would change exactly what the weather is like outside, so if it rains, it will play a rainy video in the background, if the sun is shining it will be a sunny video and so on. I already have a basic snippet of
vlookup between two google sheets copying multiple columns fast no for loop
Below is a code that I found here : https://webapps.stackexchange.com/questions/123670/is-there-a-way-to-emulate-vlookup-in-google-script I tried to optimise it to my use case in which to vlookup from source sheet ‘data’, and fill in values in destination sheet ‘s’. The problem is that…
How to create date intervals in javascript
I need to call an api, passing start and end date, but given that the interval is too wide I am thinking that I need to do several calls using smaller date intervals. This is how I am trying to set start and stop dates: but I am getting this result (start date is updated correctly but stop date doesn’t
stop counter on data attribute for multiple values
I have many divs that contain an data-attribute with a different value for each I try to print this value by counting using javascript The problem is that the counter doesn’t stop on the data-num value it counts to infinity How can i stop the counter for each one in the value of data-num for each div? A…