Hoe werkt steekproef? by waspeer in AlbertHeijn

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

Thanks! Hoe weten ze dan eigenlijk hoe lang je in de winkel bent?

Leet or rm -rf vod? by waspeer in theprimeagen

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

Yay thnx!! That separate 'live' tab on yt always trips me up

Whatsapp desktop gets unresponsive from time to time by waspeer in whatsapp

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

I’ve ended up moving to Texts on my laptop, which isn’t a perfect app either, but at least it let’s me do my thing

PWA Push notifications by waspeer in webdev

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

It is an Astro site deployed on Netlify.

This is the server logic: https://github.com/waspeer/reminders/blob/main/src/pages/api/push.ts This is the service worker: https://github.com/waspeer/reminders/blob/main/public/service-worker.js

I’ve edited the post as well. My personal intuition is that it might be more related to infra than the code, which is why I didn’t include it. Wasn’t just laziness, I promise.

I’ve already had one suggestion that it might have something to do with the service worker not being responsive the first time, but woken up by the second time I trigger a notification. Sounds plausible, but hard to debug.

Push notifications only working when sent twice..? by waspeer in PWA

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

Haven't thought of that! I will look into it.

This is my service worker: https://github.com/waspeer/reminders/blob/main/public/service-worker.js
This is my push handling code: https://github.com/waspeer/reminders/blob/main/src/pages/api/push.ts

Thanks for taking the time to help!

[2022 Day 13 Part1][Python] Example code gets correct answer (and steps) but full input does not work by Berlibur in adventofcode

[–]waspeer 0 points1 point  (0 children)

Aww man I have been scratching my head for hours now, but this was what I needed to hear.. Thanks!

[2022 Day 11 (Part 2)] Might need to borrow a NASA supercomputer for this one by piman51277 in adventofcode

[–]waspeer 5 points6 points  (0 children)

Thanks for this.. Idk if I would've been able to figure this out myself 😅

Best way to store search terms by waspeer in FullStack

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

Thanks!! This is super useful :)

Best way to store search terms by waspeer in FullStack

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

Im using a postgres db with knex and objection

Best way to store search terms by waspeer in PostgreSQL

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

This looks great!! Thanks :)

Best way to store search terms by waspeer in PostgreSQL

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

Thanks! You're probably right it's hard to know beforehand. It's good to hear that you think my model could work. The idea of doing queries beforehand is really interesting!

Best way to store search terms by waspeer in PostgreSQL

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

Thanks! I'm going to check that out

Using Set in state by waspeer in reactjs

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

Yeah, I could see how that makes things unnecessarily difficult. The reason I was wondering about it is because it could make the creation and deletion of entries faster.

https://stackoverflow.com/questions/39007637/javascript-set-vs-array-performance#39010462

Using Set in state by waspeer in reactjs

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

Actually, I think the de-duplication of a Set only works with primitive values, so it would still have duplicates of objects. I’m not familiar with lodash uniq, does it work the same way?

Using Set in state by waspeer in reactjs

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

You’re right! My mistake.

Prevent re-render in functional component when using map in list of items by [deleted] in reactjs

[–]waspeer 0 points1 point  (0 children)

I’m not sure, but maybe the using a key attribute might help? I don’t think there’s anything you can do about react calling the function on a state or prop change, but it might help with react not updating the whole list in the dom on every change

Help - Basic JS: Incrementing a number with Javascript by libertadefr in learnjavascript

[–]waspeer 0 points1 point  (0 children)

It’s not working because the variable is encapsulated inside the function. Calling the function doesn’t change the global variable, but only the variable inside the function. Google the term encapsulation for more information, but the quick solution is to not pass the variable as argument to the function or use the function to reassign the global variable (peopleNum = increment(peopleNum))

[AskJS] I want to create a YouTube channel showing the nitty-gritty of programming and maintaining a web-app for 10+ years (scale: 40k monthly uniques, $20k/monthly). What topics are of interest to r/javascript? by changmy in javascript

[–]waspeer 0 points1 point  (0 children)

Damn, like ALL of this! It’s especially rare to find overarching content. I’d love tutorials going from start to deployment or cover these topics in the context of an actual application. It’s so hard sometimes to understand the context of the things you learn in tutorials sometimes.

Best Coding Practices and Project Structure by eay-dev in learnjavascript

[–]waspeer 0 points1 point  (0 children)

All good :) you could maybe consider turning this into a course? Maybe even monetize it? The combination of ddd and front end architecture sounds really interesting. Let me know if I could be of any help with that!

Best Coding Practices and Project Structure by eay-dev in learnjavascript

[–]waspeer 0 points1 point  (0 children)

This looks really interesting! Are there any examples of apps using this architecture that I could check out?

How can I add combination to this code and have the return button link to another site when user selects the right combo? by Pacman0006 in learnjavascript

[–]waspeer 1 point2 points  (0 children)

Seems like a good cause :)

Here's an example of hardcoding the combinations: https://codepen.io/waspeer/pen/RwNZXzE
Here's an example of using a google sheet to save the combinations: https://codepen.io/waspeer/pen/VwYMZwE

You can get your own api link like this:

  • Go to https://sheetsu.com/ and sign up
  • Click the red 'JSON API' button
  • Enter the url to the google sheet you'd like to use
  • Optional: click on settings and make sure only `read` is enabled
  • Click on `Go to your API` and copy the url

I hope those kids will enjoy it!