Kevin Powell - Community

KPC

Kevin Powell - Community

A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.

Join

front-end

resources

back-end

ui-ux

os-and-tools

node-canvas error

node-canvas error
Is there any other library I can use since `node-canvas` seems to be an issue, please recommend.
Is there any other library I can use since `node-canvas` seems to be an issue, please recommend.
I tried using node-canvas with jsbarcode to process barcode from a node application but node-canvas seems to be an issue ever since I tried implementing using it.I have tried rebuilding from source yet the error still a blocker....

My life has been blocked by CORS policy: Response to preflight request doesn't pass access

Who doesn't like a bit of monday morning cors? 😆 Was hoping that someone could help me narrow down my issue if they've got a sec. I've a FE and BE server, FE using axios, BE express. Locally, the FE is on port 4600, backend 3550, and there doesn't seem to be an issue. I'd thought that was because I'd set the correct headers on the server:...

IntelliJ issue

I cloned a project I have to do for a Udacity nanodegree in java using IntelliJ. But for some reason, that project window is not showing any documentation when I hover over things. But if I try to open another project, it will work as expected, showing documentation as you hover over things. So I'm guessing it's this specific project that's giving some issue.

why does me delimiter / replace not remove commas in my csv file?

And also how do i change the date format from YYYY-MMM to DD-MM-YYYY(for example: 2022 Jan-> 01-01-2022(all the days start with day 01 since there is no day) only with using import datetime and import csv, no pandas). I tries using ai and just googling it ,but it does'nt work(or its using pandas), gives me constant errors for some reason. Please help, would greatly appreciate it

Firestore won't let me one more map to they array

I'm in desperate need of help handling Firestore rules. I have these rules to handle the collection on the picture I provided: ``` rules_version = '2'; service cloud.firestore {...

How to hide access token without API proxy server

I'm trying to display images of Instagram on HTML page and deploy on a hosting website. I only know HTML, CSS and a bit of JS. I tried using the API proxy server by following youtube tutorial, but I'm getting a lot of errors. is there any way I can avoid that?...

Firestore security rules for objects inside of the array

Hi everyone! In my Firestore, I have a collection called "items" and there are couple of documents inside. Some of these documents have "reviews" property, which is created by arrayUnion() called from my front-end and the objects inside of this array always have 4 properties, one of them is userId. In my front-end, I'm sending a get request to get the whole reviews array, like this: doc.data().reviews. How can I write my security rules so that userId is never returned no matter what? I asked ChatGPT to help me write the rules, but these doesn't work:...

Create a list of links in PHP?

Hi, I have this page https://chrisbarin.com/membership-account/membership-checkout/?level=1 built in WordPress that's using a very tricky plugin. I have little development experience. I'm looking to replace those blue links which are automatically created with custom links and text. So I'd like to replace the code with something like <name> then <url> so that I can easily change both. Here's the entire code of that page in case it helps: https://pastebin.com/8ieDGPaD PS: I only need the blue links edited, not the array of benefits underneath....

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource

Was working on a small blog type website in free time, heard MongoDB is decent for storing text content. Looked into it, went through CRUD and everything. When finally used it, ran into this error. I'm trying to store article content (title, date, author, body, img urls etc..) as json on atlas and using nth child to use it on webpage. When i use fetch in my js file to get data from the link i got from mongoDB connect page, it returns this error...

dotenv in production?

Anything wrong with using dotenv in production? i can't see anything to suggest there is, but thought I'd check given it's a security thing. Googling throws up an article outlining issues that don't really apply to me https://dev.to/gregorygaines/stop-using-env-files-now-kp0, but I've also seen an article countering that one 😄

Requests between webservers in Nginx

So I've got 2 servers up and running on my Nginx server. Both are working/routing correctly, and I've made one a subdomain of the other: api.example.com & example.com If I need to communicate between the two do I still just make a request to api.example.com? Is that request going out to the internet and then back to Nginx, or is there a way to tell Nginx just to make the request directly?...

`Cant install mongodb on mac`

I cant install Mongodb on my mac keeps failing with the error below

1st time picking up a database, require recommendations

Hello, I'm starting to learn a bit about the backend database and I been seeing RethinkDB, MongoDB, OrientDB, and many more. With so much to choose from, I want you guys to recommend me one as someone new to all of theses databases as you guys will know more about which one is better or easy to use for someone starting out like me. I would be using this with React.js so if there is one that works well with React I would prefer that. Thanks in advance 🙂...

Puppeteer (nodejs package): need help understanding page.evaluate & elementHandle.evaluate

Hello, Learning nodejs' puppeteer package for webscraping right now. Please, correct me, if I'm wrong: I believe evaluate, takes in a pageFunction, runs it against the calling object. The point of having those functions in those classes is that we can access members of that object in our callback and perform work with it (e.g. . Am I right on all of that ? ...

Classes repetitive

What's the best way to shorten/one class a multiple class/model? I have seen our line of codes repetitive a same class with just different class name but with same arguments inside. ``` ...

Artisan Problem

I'm trying to learn a little about laravel and was attempting their tutorial, but when I set up my project and ran: php artisan serve I get the following error: In PackageManifest.php line 177: The C:\Users\Ted\Documents\Web Development\PHP\laravel\chirper\bootstrap\cache directory must be present and writable. ...

More file structure, this time webpack flavoured!

Thought I'd make another thread as this is kind of a different, but very related, question I've been developing locally using webpack and vanillajs. My server is hosted on digitalocean with ubuntu. As mentioned in my last question I build locally, push to a github repo, and then pull that repo in to my server. I plan to use github actions from next week thanks to @joao6246 advice, but for the time being that's the (maybe less than ideal?) set-up I learnt from frontend masters My Server folder structure:...

File structure on my server

I've ubuntu running on a digital ocean droplet that I was planning on using to clone a github repo of mine that I use locally. In that repo I have my usual dev/build folder structure, so I can build locally, but that'll mean when I pull the repo from my server it'll have all the dev files. Just wondering if this matters, or if there's a better way to do it? Sorry if this seems simple, but this is my first time sorting my own server 🙂...

Scheduled code execution

If you need a piece of code to run at exactly x date at y time, but also another piece of code (like a reminder) some 10 or whatever minutes before that date...how would you accomplish that? Cron jobs? on your API code or a separate Cron service? Any other methods you would use? All ideas welcomed

Error when trying to create an image in Node js

```js function BW(){ let pixels=[]; for(let i=0;i<256;i++){ pixels.push(random(0,255))...