Category "javascript"

How to sort sum up all values from object arrays inside react props

I would like to sort three top rated posts. The current function of displaying three post titles and their rating, but I can not sort them by best rating. Pleas

React Firebase upload images for each post

In Storage need to create a folder for each post and then display all the photos from the folder in posts Can you suggest the best way to do this? And also when

Dependency not found in Nuxt when defining alias in nuxt.config.js

I'm getting this error when trying to import a file using a custom alias: import api from 'api' api in ./node_modules/babel-loader/lib??ref--2-0!./node_modules

The best way to resize canvas with its objects

I have a Fabric.js canvas inside in a responsive design with boostrap. To resize the canvas, i use canvas.setDimensions({width:w, height:h}); From the width and

Convert a Canvas element into Image element

I have a website where I need to generate dynamic images specific to the user. The approach I found was using canvas. I have text information and image file whi

My event handler is executed before the event is fired, why?

I have a pop up window with a button. When I click the button I want something to happen, say an alert. The issue I am having is that the onclick event fires as

React useEffect infinite loop when using dependencies + cleanup

I know this question gets asked a lot, but from the answers I could find I saw: either no cleanup function in useEffect (so not my use case) people not using de

convert date shamsi to miladi in js

I have a date in this format 1379/10/02 Now I want to turn this date into AD That is, the date 2000/4/29 I also use the momentJs library Please help me if possi

Back-ticks for DOM query selector

I was building a drum kit from the JavaScript 30 challenge with the help of the source code and I came across the code below, but I don't seem to understand how

Why isnt my Bootstrap datepicker working?

I have a Bootstrap datetimepicker component in my code that was working a few weeks ago but has stopped working. I appreciate any help getting to start working

how to find all cycles is in given undirected graph

I want to find the cycles with impar amount of nodes is in graphs. To do that I made the following algorithm which does a dfs walk through the graph and when it

React Parent component calculating width and height of Child Component

I have a Parent Component that is repeating a generic Child SVG component over the the screen. In order to do so the Parent Component needs to know the dimensio

Javascript Grouping by object property, when property is an array

I currently have an array of items that looks a bit like this: I want to group the items by category lookup, with the slight problem that category lookup is pot

GTM Custom HTML Tag and Javascript Variables

I have 2 custom javascript variables (fx_geoLatitude, fx_geoLongitude) that capture latitude and longitude of the user when the page loads on their first sessio

how to style menu.item on semantic ui React <input> search bar precisely

The code is the menu style of semantic ui available for React including a search input i want to increase the size of the search input and also change the color

AWS-Amplify, How do I redirect to another URL after sign-in in angular?

I'm using the latest AWS-Amplify's authentication component. It can logged in successfully but after login I need to sent the route to another url which I can't

LiveServer on WebStorm

I have a problem with WS live server. When I open my HTML file in chrome, the page had address: http://localhost:63342/Home/index.html?_ijt=ler2r6h082ng7c8a0p53

How to let Pix2Pix with p5.js run?

I would like to try the ml5.js Pix2Pix example for p5.js. If I just copy the code, update the paths, and try to let it run on my local server, it doesn't work.

How to increment set of 2 letters based on word occurrences in the range using GAS?

I got this one that looks hairy to me, but I'm confident you guys can crack it while having fun. The problem: Check of Company exists in the range If not, get t

Post Images Using muter and Express.js/handlebars/sequelize

I am using multer package to upload photos. I am able to upload the image file and submit it. it gets submitted into a file called images in the public folder;