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

Cannot push changes to github

In the terminal, I've given the following commands:
git remote add origin REPOSITORY_NAME
git remote add origin REPOSITORY_NAME
git branch -M master
git branch -M master
when i try to push changes using git push -u origin, it said I've to enter git push --set-upstream origin master....

Fish out of water in server side questions ...

Hi! I was just offered a web dev job by a friend, and since one can't sit and to tutorials for the reste of ones life I said "Sure! I'll fix this for you!" ... and now I'm shit scared, haha! So I have a a few questions, and I don't expect you guys to solve them all, but I need to know how to frame the problems so I can ask for proper help from developers I know can fix this. ...

paginated

This a simple one just confused, in making paginated APIs how do I know where to add the next property so the frontend developer knows it has a next page...how do I check where the next is going to be a + 1 or it's going to be null, in a database,

Correct Response code to send when DB connect fails

Which HTTP code is semantically correct to send in response to failing to connect to a database? 500 (internal server error) is a good catch-all, but it doesnt seem not be specific enough. 503 (service unavailable) is what im leaning towards but I'm not sure if it makes sense to say that the database is actually down at this time even if it fails to connect after the maximum retries...

Streams

Am using express I want to read a file using readStream in express and send to the frontend each time a buffer is ready...I want to know how to get the data on the frontend for each buffer, not waiting till all is fetched and combined into one response, it's music data with each response can I add to audio src html type to create some sort of streaming experience, is this possible? A good resources (video preferably) would be nice I've searched

host website

how i can host my website that build with nodejs and mongodb in internet server

Website using cached version

Hey guys, I've finally finished making my website. Whenever I make some changes, I have to press shift+reload to see the changes to clear the cache. I've tried everything to fix it form using head tags in my code to purging the cache from cloudflare. What are some other steps I can take?

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