October 22, 2024
Chicago 12, Melborne City, USA
javascript

How to create a tab where each tab renders a different controller?

I have a tab where the first tab renders the devise controller (edit.html.erb view) and the second one I want to render the ChartsController. How can I do this in Rails 7? My code: edit.html.erb: <div class="bg-white p-8"> <div class="tab-section rounded-lg min-h-[400px]"> <div class="flex flex-wrap gap-1 border-b border-stone-300"> <button class="inline-block p-4 text-stone-600 font-semibold rounded-t-lg active"

Read More
javascript

Javascript not working on Safari console, but works in Chrome

I’m trying to simulate a click from console on the 3rd upload box. This code works in Chrome. I can browse my folder, but it’s not working in Safari. setTimeout(function() { // Sélectionner tous les éléments avec la classe 'uP74h0hWZUzbcqM1doHG IazVbeuKn6e3j5HwOjS7 newImgCreate' let elements = document.querySelectorAll('.uP74h0hWZUzbcqM1doHG.IazVbeuKn6e3j5HwOjS7.newImgCreate'); if (elements.length >= 3) { // Sélectionner le 3ème

Read More
javascript

How can I change window.location?

According to the locale value, language information comes after the domain name in the URL. For example, when it is tr, it is http://127.0.0.1:3000/tr/home. When it is English, it is http://127.0.0.1:3000/en/home. When locale tr comes, I want to do tr. When en gfel, I want to use en. I also want it to preserve any

Read More
javascript

Typescript: Cannot access 'createResettable' before initialization

I have a couple simple components using Zustand and NextJS. For some reason I am getting the following error: "Cannot access ‘createResettable’ before initialization". I am defining the function and importing it correctly? Not sure why I am getting this? ./quoteStore.ts import { createResettable } from "../_hooks/hooks"; // verified import is correct import { type

Read More
javascript

NW.js nw-builder. Not Displaying Icon on macOS ARM64. Demo Project

I switched from nw-phoenix-builder to nw-builder because the latter has progressed while nw-phoenix-builder has become somewhat outdated. I thought I could easily get started with nw-builder, but I was mistaken. Before implementing it in my project, I wanted to understand how it works by creating a demo, but I couldn’t find a similar one anywhere.

Read More
javascript

Stripe Subscription Renewal Stuck in “Incomplete” Status, No Auto-Renewal or Payment Deduction

I’m using Stripe to handle subscriptions in my application. The initial subscription creation works perfectly, but I’m facing an issue with auto-renewals. When it’s time for the monthly subscription to renew, the status changes to "incomplete", and the payment is not deducted automatically. This results in the subscription not being renewed, and the user ends

Read More
javascript

Cannot Read Properties of undefined in a 2-Dimensional Matrix, HTML & Javascript

I’m working on creating a pixel-based light in the dark simulation with JavaScript to improve my coding skills. The goal is to create a bubble of light around the cursor as it moves. I’m only rendering a small portion around the cursor to ensure real-time results. I tried to create this code as scalable and

Read More
javascript

Javascript – Elements added into an array not in correct place

I have a little problem to add some element in place into an array. I’m trying to add after the last lowercase letter that is z the uppercase letter of the alphabet. I’m using this code. I’ve noticed that the lower char z is added after all the uppercase letters are added into the array,

Read More
javascript

the indicator not work on tradingview show problem , i need solve it

//@version=5 İndicator(‘Nas Infinity Algo [ZZ Algo]’, overlay=true, format=format.price, precision=2) Periods = 40 Src = hl2 Multiplier = input.float(title=’Sensitivity’, step=0.1, defval=7.2) changeATR = true showsignals = input(title=’Show Buy/Sell Signals ?’, defval=true) highlighting = input(title=’Highlighter On/Off ?’, defval=false) atr2 = ta.sma(ta.tr, Periods) atr = changeATR ? ta.atr(Periods) : atr2 up = src – Multiplier * atr up1

Read More
javascript

Reducing blocking time of GTag script

If you can recognise this: <script src="https://www.googletagmanager.com/gtag/js?id=G-TOKENIDHERE"></script> It is a heavy file for the first second and so it matters. What I did: List item Used Async/Defer (but it still blocks) Loaded it in worker process via PartyTown, (see this stack answer)and the script loads, but cannot call "collect" calls, so no analytics. Google can

Read More