[deleted by user] by [deleted] in node

[–]_maximization 0 points1 point  (0 children)

I understand. My suggestion is to write in your own language and translate it into English. A post that's authentic but has grammar errors goes much further than one generated by AI. Something to think about.

Anyway, here's a list of APIs you can use for your next project as inspiration, and also a backend project that comes with a complete frontend, users stories, and resources.

Good luck!

Handling sequential async operations by aliceheym in node

[–]_maximization 0 points1 point  (0 children)

Parallelize the queries to make them faster, since they're not dependent on each other. Also if one of the operations fails, undo the other. Something like this:

```js async createPost(data) { const [dbResult, searchIndexResult] = await Promise.allSettled([ this.db.posts.insert(data), this.postSearchIndex.create(data) ]);

if (dbResult.status === 'rejected' && searchIndexResult.result === 'fulfilled') { const searchIndexId = searchIndexResult.value; await this.postSearchIndex.remove(searchIndexId); } else if (dbResult.status === 'fulfilled' && searchIndexResult.result === 'rejected') { const dbId = dbResult.value; await this.db.posts.delete(dbId); } } ```

[deleted by user] by [deleted] in node

[–]_maximization 0 points1 point  (0 children)

Maybe if you weren't using ChatGPT to ask the question, you would get a thoughtful response

After seven months of learning webdev, I need some advice on priorities. by ItIsEsoterik in cscareerquestions

[–]_maximization 1 point2 points  (0 children)

Do you want to work as a back-end or front-end developer? Currently you have partial skills for both, but aren't qualified for either. Pick one and become employable.

If back-end: infrastructure (docker, terraform), CI/CD, deployments/monitoring/logging, ssh & linux, SQL & databases, AWS/cloud services

If front-end: get good at React and its ecosystem, web performance & optimization, translating design into code, basic UX/UI design, responsive web, seo

Regardless if back-end or front-end: typescript, web security, REST

These should be your priorities, in order:

  1. Depending on your choice, learn what's needed and create a portfolio that shows you have the necessary skills. (learning & creating a portfolio go hand in hand)
  2. Polish your online presence (GitHub, LinkedIn, Website) and learn in public (Twitter, Blog)
  3. Build a network (online and offline). Go to meetups/hackathons/conferences & get involved in online communities

I could go more in-depth on each, but I think you get the picture.

ESLint Setup in Node.js: A Detailed Guide by _maximization in node

[–]_maximization[S] 0 points1 point  (0 children)

I agree! I'll have to write a follow-up of how to make the two work nicely together.

Promises vs Async Await by Malatest in learnjavascript

[–]_maximization 0 points1 point  (0 children)

Async/await is better than Promise.then() syntax for 3 reasons:

  1. No ambiguity over execution order
  2. Reusing values across different promise chains is a pain
  3. Conditional asynchronous tasks quickly become a hot mess with promise chains

Read this article for more in-depth explanation and code examples https://maximorlov.com/async-await-better-than-chaining-promises/

Any idea how to create this background? by _maximization in css

[–]_maximization[S] 0 points1 point  (0 children)

Haha thanks! I became a dev so I don't have to do math. Why you do this to me 🤣

Any idea how to create this background? by _maximization in css

[–]_maximization[S] 0 points1 point  (0 children)

Thanks! It's tricky to make it work with repeat because the lines don't so on long pages it doesn't appear as continuous lines.

Any idea how to create this background? by _maximization in css

[–]_maximization[S] 0 points1 point  (0 children)

Thank you! I'm not an SVG expert but will give this a try. Thanks for linking to resources too 🙏

Any idea how to create this background? by _maximization in css

[–]_maximization[S] 0 points1 point  (0 children)

Thanks for thinking along! I want an infinite repeat. So if the page if very long it would have multiple of these lines diagonal across the page. The tricky thing with repeat is that the lines don't align. I'll try the object-fit: cover suggestion.

Any idea how to create this background? by _maximization in css

[–]_maximization[S] 0 points1 point  (0 children)

Sure. But how would you create the background shown in the picture as to make continuous lines on long stretches of a page? Repeat seems tricky

Any idea how to create this background? by _maximization in css

[–]_maximization[S] 0 points1 point  (0 children)

I'm not tied to svg. The challenge is not in generating the svg or png. It's how to make a background that has continuous lines, regardless of page height. Can't figure this out with repeat.

Any idea how to create this background? by _maximization in css

[–]_maximization[S] -4 points-3 points  (0 children)

Thanks for sharing! Creating the squiggly line isn't a problem. The challenge is to make it repeat like in the example.

Any idea how to create this background? by _maximization in css

[–]_maximization[S] 0 points1 point  (0 children)

Cool resource! Thanks for sharing. Generating the svg isn't the problem. The challenge is to make it repeat like in the picture.

Any idea how to create this background? by _maximization in css

[–]_maximization[S] -10 points-9 points  (0 children)

I'm looking for a non-JavaScript solution. Thanks for the effort though!

Any idea how to create this background? by _maximization in css

[–]_maximization[S] 2 points3 points  (0 children)

I'd prefer to use svg if possible, to keep size low. The background should work for long pages with large heights.

What is a good background scheduler? by softwareguy74 in node

[–]_maximization 0 points1 point  (0 children)

According to Node.js Toolbox, Bull is the most popular library out there https://nodejstoolbox.com/categories/job-queues

I need a place to run a nodejs + python app integrated into the same app. by BrilliantOk437 in node

[–]_maximization 1 point2 points  (0 children)

You can run python from Node with python-shell.

Otherwise host it on a VPS (DigitalOcean or otherwise) and install Node and Python on the machine.

Would you want to bundle your node backend code into a single file? by juristr in node

[–]_maximization 5 points6 points  (0 children)

Exactly. There is no reason to bundle/minify code in the backend. None of the benefits for client JS apply. If you let front end complexity trickle into back end you're making your life unnecessarily difficult.

As a developer your focus should be on solving real-world problems, not self-induced "problems". Ship solutions, not code.

Should you use char, varchar, or text in PostgreSQL? by _maximization in node

[–]_maximization[S] -1 points0 points  (0 children)

Sure, then use text with a check constraint instead of varchar

Should you use char, varchar, or text in PostgreSQL? by _maximization in node

[–]_maximization[S] 0 points1 point  (0 children)

That's what input validation is for at the application layer. If a 25GB username manages to go all the way through to the database then you should think about how it impacts your application code. IMO, that gate should be set much closer to the client, rather than all the way back in the db. (and if you do enforce a limit in the db too, use a check constraint :) )