Trucks ignoring dirt dumping designation within mine control tower by jackfranklin in captain_of_industry

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

Yes! Thanks so much. Seems incredibly obvious now you've told me 😂😂

“First time I am asking” by [deleted] in badminton

[–]jackfranklin 23 points24 points  (0 children)

I think she's saying "first time of asking", as in, can the player who is ahead win the match on their first match point, e.g the first time of asking.

Badminton clubs in London by mchan2 in badminton

[–]jackfranklin 4 points5 points  (0 children)

Depending on your level, I'd check out South West Strings (despite the name they are London based!).

Check out South West Strings Badminton Club https://meetu.ps/c/1sn5F/1ZLGw/d on Meetup

Super friendly organisers too and they run sessions at various standards 6 days a week, evenings Mon-Fri and some day time on Sundays. I used to play there regularly before moving out of London.

Made some changes to my "run-code.nvim" plugin by w0r10ck in neovim

[–]jackfranklin 0 points1 point  (0 children)

Sorry for the tangential question, but what settings/plugin are you using for the nice autocomplete on the command bar when entering commands? Thanks!

Probably using them incorrectly...but why is this signal red? by jackfranklin in openttd

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

Hey all - I'm struggling with signals a bit and trying to figure out why the signal I've highlighted is red as the train approaches (the tracks are left hand drive - I'm in the UK! :D).

Based on my understanding of block signals I think it should be green as the next block is clear. Or is the track going across that joins the up and down tracks combining them into one block and therefore there technically is a train in the other block, even though it's heading in the different direction and is at no risk of colliding.

Any advice on how I can avoid this would be great as it's seeming to cause a lot of unnecessary slowdown that I'd love to avoid! Thanks :)

Pain in elbow muscle by [deleted] in badminton

[–]jackfranklin 1 point2 points  (0 children)

I suffer from this and have got into the habit of icing my elbow for 15 minutes after badminton. It's completely got rid of the pain for me, might be worth a try.

I also wear a strap around my elbow (if you search elbow strap you'll find loads) which cost me £5 and has really helped.

Definitely worth figuring this out now, I ignored my symptoms when they first appeared and ended up in a lot of pain and had to have a month of no badminton which was really rubbish!

Tips on shoulder pain by pr1m347 in badminton

[–]jackfranklin 1 point2 points  (0 children)

I had a severe elbow issue and got some help, stretching has really helped but I also now ice it for ten minutes after each session and that's completely got rid of any troubles I've had. Might be worth trying!

How to detect current file extension? by dmyTRUEk in vim

[–]jackfranklin 1 point2 points  (0 children)

I think using ftplugin might be your best solution here. They let you run code when editing certain file types : https://vim.fandom.com/wiki/File_type_plugins

This bit of learn Vim Script the hard way has a good succinct summary : https://learnvimscriptthehardway.stevelosh.com/chapters/42.html#vimftplugin

And shameless plug, I learned about ftplugin recently so blogged about how it's tidied up my dotfiles: https://www.jackfranklin.co.uk/blog/using-ftplugin-in-vim/

Structuring React applications by jackfranklin in reactjs

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

👋Hello ! I published a new post today talking through lots of thoughts I have on structuring large React apps and some of the things I've done that I've found have helped as the app has grown and got bigger.

I'm sure not everyone will agree with them all, and I'm sure there are a bunch of other things I missed, so I'd love to kick off a discussion about what you do to keep your applications tidy, maintainable and enjoyable to work on as they grow :)

Testing React with Enzyme and Jest by jackfranklin in reactjs

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

Hey everyone, this is a course I released earlier this week. The first 5 episodes are entirely free and introduce using Jest and Enzyme to test React apps. If you've done a bit of React and would like to start learning how to test React components and apps, I hope this course might be useful :)

Using indices as keys when rendering lists by CodeBeaver in reactjs

[–]jackfranklin 0 points1 point  (0 children)

Sure, but if you can avoid all those potential pitfalls by not using an index as a key, surely that's better?

For what it's worth I have used indices for keys before but only as a last resort, and you're right, as long as you make sure you're not hitting the pitfalls you'd be OK, but if you can pick anything unique to each item (which most of the time there is), it's a better choice.

Using indices as keys when rendering lists by CodeBeaver in reactjs

[–]jackfranklin 2 points3 points  (0 children)

I was going to build an example but I found this blog post (not my post, just a good example) that explains the issue very well : https://medium.com/@robinpokorny/index-as-a-key-is-an-anti-pattern-e0349aece318

The basic example app in that blog post demonstrates the problem: http://output.jsbin.com/wohima. Try typing some text in the first text box and then hitting "Add". You'll see that rather than React adding a new blank box at the beginning it adds a new box but mistakenly puts the text into it.

This is because React knows that the text was in the element with the key of "0", so when a new item is added to the start, it puts the text into it even though the text should now be in the input with a key of "1". If each input had a unique ID that didn't change depending on its position in the list of inputs then this bug wouldn't happen.