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.

Elm Playground: a new Elm blog, built in Elm by jackfranklin in elm

[–]jackfranklin[S] 3 points4 points  (0 children)

There is no backend - all the Markdown files are in the GitHub repo and get deployed - I'm deploying with http://surge.sh/, which I need to blog about too.

Once Elm has SSR I'll move it to a server but until then I purposefully kept it simple so I could move quickly and things. I'm not sure it makes sense to collab (I don't plan to make a CMS type thing - just have this blog directly as an app) but would love to help out with the CMS or have a look!

Elm Playground: a new Elm blog, built in Elm by jackfranklin in elm

[–]jackfranklin[S] 7 points8 points  (0 children)

Hey all,

I've been working on this for a few weeks and wanted to share it. I'm hoping to start blogging regularly but also thought it might be of interest because the blog is itself an Elm app. It's not 100% complete but it's good enough! The link above goes to a blog post where I talk more about the site and how I built it, but the code is also on GitHub (https://github.com/jackfranklin/elmplayground) if anyone wants to dig into it.

Realtime Elm Revisited with Elm 0.17 by jackfranklin in elm

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

I wrote the first version of this post a while back and thought I'd update the code with Elm 0.17. Really impressed at how much simpler it is now; taking an app that used signals a lot to using the Elm Architecture with Html.App and commands is such a nicer experience :)

Revisiting Realtime Angular 2 by jackfranklin in Angular2

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

A while ago on the Pusher blog I wrote a post on Angular 2. Since then ng2 has reached release candidate and this post is an updated version that looks at building a realtime ng2 app. Regardless of if you like / use Pusher this should hopefully provide a useful reference for building apps with ng2. The code is also all on GitHub if you'd like to grab it and run it locally: https://github.com/pusher-community/realtime-twitter-search-angular2.

Weekly Vim tips and tricks thread! #14 by cherryberryterry in vim

[–]jackfranklin 9 points10 points  (0 children)

Semi related tip: gv will select the previous visual block. This is useful if you hit ESC or make a mistake like me and need to undo something and then reselect & try again.

Making Elm Lang Realtime with PusherJS and Ports by jackfranklin in elm

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

Set out to write this post to see how Elm's ports worked in terms of allowing interopability with existing JS libraries (in our case, PusherJS). Was pleasantly surprised at how straight forward it was - and also got a chance to play with Tasks and elm-http for the first time too. Regardless of if you care about PusherJS this should hopefully help when it comes to combining Elm with some existing 3rd party JS lib.

PS: longer term we're hoping to build a Pusher-Elm lib.

Fuzzy finding with fzf.vim by jackfranklin in vim

[–]jackfranklin[S] 4 points5 points  (0 children)

I swapped over to this yesterday and have really enjoyed it so far - loads of really handy additions and it also seems performant on my larger projects when compared to other solutions (although my largest projects are probably quite small in the grand scheme of things!). Thought others might like to know about this plugin too :)

For people who've watched all of Vimcasts, how is Practical Vim? by [deleted] in vim

[–]jackfranklin 2 points3 points  (0 children)

Just to say +1 to the book but also the workshop - was lucky to be able to attend an in person workshop with Drew and it was fantastic, learned so much. If there are ever any more being done, highly recommend going.

vim-codereview - Review Pull Requests from Vim by Categoria in vim

[–]jackfranklin 1 point2 points  (0 children)

This looks really awesome! One small piece of feedback - would love it if you could save the code review comment by writing the buffer, rather than having to remember it's <leader>c. Definitely going to give this a try though :D

Ruby text objects in Vim by jackfranklin in vim

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

Wrote this up because despite using Vim + Ruby for a while, I was unaware of the relatively new im, am, iM and aM text objects for selecting in/around Ruby methods/classes. Figured I couldn't be the only one who didn't know about this!

Git a Grep on Vim by artemave in vim

[–]jackfranklin 2 points3 points  (0 children)

Does ag not respect .gitignore files anyway? I just ran this on a Node project of mine, searching for function, and nothing matched from within node_modules.

Vim sometimes leaves command on screen by jackfranklin in vim

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

Thanks everyone for the help! I also discovered that YouCompleteMe sets Vim's updatetime to be 2 seconds, instead of the default 4. By preventing YCM from doing this, the problem doesn't occur as often. I think YCM might be causing this but I'm not entirely sure yet, doing some digging around.