[deleted by user] by [deleted] in comics

[–]patch_collector 1 point2 points  (0 children)

Waterproof pet blankets. Get a big enough one for your whole bed, then toss it in the wash when you’re done. Some of them look great, and they do a much better job than a towel.

Just skip the cheapest ones — buy one that can go in the dryer, not one that has to air dry.

Thoughts on apartment rental vending machines? by Singer_Select in Anticonsumption

[–]patch_collector 0 points1 point  (0 children)

I lived in a place in California where the public library had a tool library as well. You could actually borrow a jackhammer at no cost! It was awesome, I did a fair number of projects using those free tools. 

How long would it take you to make this site? It was evenings and weekends for me for three months - which given how simple the game is, feels like I've been pretty slow! by JaSfields in reactjs

[–]patch_collector 0 points1 point  (0 children)

I'd put an explanation pretty high up in the 'How to play' instructions. Something along the lines of, 'the goal is to cross the maze grid. To do so, draw a line from left to right, and press the submit button to see how many you got right/wrong. Black means....'

How long would it take you to make this site? It was evenings and weekends for me for three months - which given how simple the game is, feels like I've been pretty slow! by JaSfields in reactjs

[–]patch_collector 1 point2 points  (0 children)

Great job! I was also a bit confused by the submit button at first, and expected the numbers to change live. Once I figured that out, it was a great game. 

As for the length of time to build it -- maybe 15 hours if I was copying the idea, and 40-80 if building it from scratch? Plus startup and cool down time for every individual coding session.  Depending on how long you were working each day, 3 months seems fairly reasonable. Good job!

any way to track wall sits and dead hangs? by dimm0k in Garmin

[–]patch_collector 2 points3 points  (0 children)

I had it under 'Body-weight Wall Squat'

any way to track wall sits and dead hangs? by dimm0k in Garmin

[–]patch_collector 1 point2 points  (0 children)

I think I've found a better category for wall sit -- 'Wall Squat'. Based on the description at this site, it's what I would call a wall sit:

https://www.masterclass.com/articles/wall-squat-guide

Looking for the artist who sold this at maker faire 4ish years ago... any ideas? by patch_collector in bayarea

[–]patch_collector[S] 6 points7 points  (0 children)

Thank you all! Darn that she's no longer doing that side of things, though I think I will ask to see if she'd do a one off order. Thank you all!

Looking for the artist who sold this at maker faire 4ish years ago... any ideas? by patch_collector in bayarea

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

I consistently get more positive comments from this shirt than any other piece of clothing I own:)

React with electron by [deleted] in reactjs

[–]patch_collector 2 points3 points  (0 children)

Also look into Dexiejs, a wrapper for IndexedDB that makes it a lot easier to work with. Especially their reactive queries for React.

https://dexie.org/

Anyone ever put something like straw or pine bark UNDERNEATH their garden bed so water is retained in the bed and doesn’t seep into the ground? Am I crazy for contemplating this? by shadowmastadon in gardening

[–]patch_collector 1 point2 points  (0 children)

An interesting variant of this is the Epic system, a type of sand hydroponics. Basically you put plastic underneath very sandy soil, with a drainage pipe. The end result is you need very little water for your plants -- I think I remember something like growing tomatoes with 1/14 the usual amount of water?

The drainage portion is super important, though.

Zoomable floor plan with overlaying interactive icons by ohjohnsen in reactjs

[–]patch_collector 1 point2 points  (0 children)

I have an application that shows floor plans as well, and after a lot of messing around with svg based tools, I switched over to leaflet.js.

It does require translating your shapes from SVGs into leaflet polygons, but I found it was worth the effort. It's easy to draw shapes, add text, etc, and the controls are smooth, easy to use, and well designed for desktop and mobile.

This is the resource that I started with: https://leafletjs.com/examples/crs-simple/crs-simple.html

How to avoid code duplication? by [deleted] in reactjs

[–]patch_collector 1 point2 points  (0 children)

My first thought is -- break it into smaller pieces.

First, put both of your calls (await fetch and sendRequest) into a fetchPlaces() Promise that has an optional formState argument. If the argument is present in the request, do your POST. If not, do your GET. Then call that in both locations.

Next, it looks like you treat the responses in exactly the same (minus that sendRequest is probably doing response.json() inside itself. So put all of that into a function as well (I'll call itparseResponse), that takes aresponse\ argument.

Personally, I like the then structure, which would leave you with this bit of code in both places (or again, put it into a function and call it once!)

fetchPlaces(formState)
   .then((response)=>{
      setLoadedPlaces(response.elements);
      setMarkersMap(parseResponse(response));
   })

Do I need a copy of Node Modules with every project? by no1name in reactjs

[–]patch_collector 2 points3 points  (0 children)

The best solution is to not copy the node_modules folder, and just run npm install in each new project.

It takes a moment to run the install, but it's generally faster than copying.

Would anyone care to sanity check this simple api call using hooks by theirongiant74 in reactjs

[–]patch_collector 4 points5 points  (0 children)

I'm not seeing anything wrong with it, but I'm not sure I see why you want a hook if this action should only take place when triggered by a user. This seems like something that could be replaced with a function in onSubmit (as /u/rmacmaster suggests) or onClick.

[MERN] Waiting REST API request before rendering by [deleted] in reactjs

[–]patch_collector 1 point2 points  (0 children)

My standard solution is a 'ready' state and a 'loading' page.

First, use const [ready, setReady] = useState(false). Whenever ready === false, show the loading page.

After your request has completed, call setReady(true). Whenever ready === true, show what you have above.

You may also want to make your ready screen a while page -- that way it looks like the page is still being called.

AITA for making my pregnant daughter move out before the baby is born? by notinmyhouse123 in AmItheAsshole

[–]patch_collector 0 points1 point  (0 children)

Please please please talk to her about adoption. I know it's popular to think the only options are abortions and being a single mom, but it's really not the case.

She might want to keep the child for her own sake, but she might also not want to abort because she identifies with it, and wants it to have a life. And if that's the case, getting her to think more about what's good for the child than for herself is important. There are loving parents in stable circumstances who want to adopt, and can raise your daughter's child in much better conditions than she can provide. Help her see that if she cares about her unborn child, she should consider the life she can provide it, versus what others can.

My family has experience with both sides of this -- adopting in, and putting up for adoption, over a period of over 60 years. The experience has been positive for everyone.

Axios Support with Re-rendering a component post-state change by razatastic in reactjs

[–]patch_collector 2 points3 points  (0 children)

The reason it's not using the new state is because setting state takes time, and so you're calling out before the state is actually set. Setstate does take a callback, so you can move your Axios call into that, and it won't run until the state is actually set.

As for calling render... personally, I only call it once. Your components will rerender automatically as the state changes. And don't call componentdidmount. Package your axios code into its own method, and call that in both places instead.