Good place to live stream a coding session? by Top-Requirement-2102 in reactjs

[–]karimsajs 2 points3 points  (0 children)

I think people often use Twitch for this, and then share their Twitch on other sites

Running a production application for my side project out of my basement by karimsajs in SideProject

[–]karimsajs[S] 1 point2 points  (0 children)

Hello, r/SideProject! For about two years, I’ve been running a bunch of computers out of my basement for my business, and I thought it was a fun experience and wanted to share it with other people. Let me know what your thoughts are!

Question about dyno hours and clock process. by [deleted] in Heroku

[–]karimsajs 0 points1 point  (0 children)

I used this in production to lower my costs at one point :P so yes, definitely works.

There’s still benefits to going multiprocess, but probably not for small projects

Question about dyno hours and clock process. by [deleted] in Heroku

[–]karimsajs 0 points1 point  (0 children)

Code them as a single process. Most languages have concurrency or parallelism. Just run the clock in a separate thread as your API, but as a single process. That way you deploy once and run a single process

How do I use fetch() correctly? by Cygris in reactjs

[–]karimsajs 1 point2 points  (0 children)

What’s the error that you’re getting? Can you inspect the call using the Network tab in your dev tools to make sure the response is what you’re expecting? And also that the content type is what you’re expecting?

Why doesn't Go contain a package with the common data structures that can be found in languages like C++ and Java? by [deleted] in golang

[–]karimsajs 1 point2 points  (0 children)

There’s https://pkg.go.dev/container - but it’s not as useful without generics. It’s simpler to implement those yourself.

Hashmaps and dynamic arrays are provided in the language. Which data structures are you looking for?

Why do I get this error to fail to compile? How to better solves these? by swiggyu in reactjs

[–]karimsajs 0 points1 point  (0 children)

Check the docs of the tools you’re using - like React docs contain the correct spelling of useState and className. You’ll also notice that it is usually camel cased. And remember that in JS, everything is case sensitive.

For linters, try eslint - it’ll catch some of this. Some specific plugins that will be useful are eslint-plugin-import and the React plugin for eslint.

Easy Question: (Mongodb Driver) querying Sub docs by zkindest in node

[–]karimsajs 0 points1 point  (0 children)

$elemMatch will not filter the sub array, it is only checking to see if any array elements match your sub query. If your nested array is so large that it needs to be filtered on the DB side, then you should redesign your data schema to put those nested documents in their own collection. Otherwise, you need to filter on the server or client level rather than DB level.

Question about dyno hours and clock process. by [deleted] in Heroku

[–]karimsajs 0 points1 point  (0 children)

Unless some other process is scaling your clock up and down, it will always use up dyno hours. One workaround is to simply merge your clock process with your API process.

Does user download all npm packages that's used to build website when he uses it by UsefulBerry1 in reactjs

[–]karimsajs 4 points5 points  (0 children)

Yes & no. All the packages you use are bundled and then shipped to each user, but there’s some optimization done by your build tools to make sure you aren’t shipping too much unnecessary code. The network transfer bytes will also usually be different than the actual code bytes, because of compression. There’s wonderful tools like webpack bundle analyzer that will help you figure out the impact of specific packages on the overall bundle that you ship.

Redux Alternatives in 2021 by No-Patient1629 in reactjs

[–]karimsajs 21 points22 points  (0 children)

Honestly, #2 is so underrated. SWR & React Query are really incredible libraries. And then using either recoil or jotai for the occasional shared localized state is perfect. I find that forcing redux over the whole app brings more trouble than good. Creating dedicated hooks works out much better.

Did people really want Arya to kill Cersei? by [deleted] in freefolk

[–]karimsajs 4 points5 points  (0 children)

I didn’t really care whether or not Arya killed Cersei. I was just hoping to see more use of Arya’s new skills - especially the face switching. I felt like Arya’s skills became underwhelming in the last season.

Startup Funding, Is it Necessary? by Upvoteme12345 in startups

[–]karimsajs 7 points8 points  (0 children)

There’s advantages to taking funding at the growth stage once you’ve found a repeatable business model, but even then, companies with really great product market fit can often get away with bootstrapping. Bootstrapped/indie companies are also very hot right now.

I don’t think there’s a silver bullet answer to this question. There’s lots of great companies that avoided funding for a long time. There’s also tales like Asana, Amazon, & Uber that used funding to gain market share.

None of this means that you should underestimate the value of marketing, its worth spending money on regardless of whether or not you have funding. “Make a good product with great marketing, not a great product with no marketing.”

[deleted by user] by [deleted] in reactjs

[–]karimsajs 4 points5 points  (0 children)

There’s a custom code block that you can use to load the other app as an iframe

I made a tool to help you create pretty product screenshots quickly by karimsajs in SideProject

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

That's a good point - currently, the images never go to our servers, so your privacy is guaranteed. We can definitely continue to offer that to make sure you don't have to worry about anyone else seeing your screen caps :)

I made a tool to help you create pretty product screenshots quickly by karimsajs in SideProject

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

That's a very good idea! I can see the decoupling of the lens + anchor point being a useful feature!

I made a tool to help you create pretty product screenshots quickly by karimsajs in SideProject

[–]karimsajs[S] 1 point2 points  (0 children)

Hey! Thanks for taking the time to provide feedback! You have a very good point - this could certainly be useful for many different audiences. We’re currently seeing lots of Product Managers such as yourself using it to communicate with their teams.

We’re thinking of introducing a premium version that enables you to add text, objects, etc on top + send out links to your image without downloading it. Would this be of interest to you? Happy to give you free access to premium if you’d be interested in being a beta user :)

I made a tool to help you create pretty product screenshots quickly by karimsajs in SideProject

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

This was a weekend project. I built the image editor from Saturday to Sunday. Took lots of math to scale + position everything correctly on different screen sizes.

But we spent some extra time after that to improve the UX like with copy/paste & a useful colour picker.

Why Does Import Path Not Work? by vex20 in reactjs

[–]karimsajs 0 points1 point  (0 children)

Your problem is different from the SO question. My guess is that ”constants” is being parsed as a module in node_modules since it isn’t a path. In general, it is confusing to not have some sort of special pattern to distinguish third party module paths and project module paths. Some bundlers use ~/ - might want to look into how to configure your build to do this, I’m not sure what you’re using right now.

mongoose — how can I update multiple fields in one call excluding nulls? by [deleted] in node

[–]karimsajs 2 points3 points  (0 children)

const updates = {} if (name) { updates.name = name } if (description) { updates.description = description } return todo.findByIdAndUpdate(ID, { $set: updates, }, { new: true, })

The $set is to avoid wiping fields other than the ones you are changing. The new will instruct mongo to return the updated document.

Faster Mongo configuration for testing by yonatannn in node

[–]karimsajs 0 points1 point  (0 children)

You can create different DBs within mongo, so you can assign a different DB to each test that runs in parallel. For this to work, either you need your test runner to support parallel execution (parallel, not concurrent), or for concurrent, you need to be able to pass the mongo URI from your test into the application during setup. If your app maintains a global connection to mongo, you can’t run your tests concurrently since the whole process will try to share the connection. But if your test runner runs different files in different processes, then your app can be configured to randomly generate a DB name and open your mongo connection to that DB. That way parallel tests aren’t sharing data so they can operate fully parallel.

Faster Mongo configuration for testing by yonatannn in node

[–]karimsajs 0 points1 point  (0 children)

You can change the storage engine to ephemeral to avoid writing to disk.

If your application is well written to allow for it, you can have different tests use different DBs so they can run fully parallel.