BRIEFS logo BRIEFS

Create git-ignored playground files in your project

03/22/2021 , 2m, 32s

So one thing that I do, you know, how you like you do something just you've done it forever and then when you show it to somebody they're like blown away like, oh man, what a good idea, whatever nobody is said that to me on this one but I thought I'd be one of those things that um that I just do it naturally in and you might find it to be useful so in my global git ignore for my machine.

I have a pattern for ignoring anything that includes the text dot ignored dot and and so then I can create a folder.That's like temp dot ignored dot staff or more often I'll create a file that's like temp dot ignored dot js and what this allows me to do is I create a file like that within my project that I just want to play around with stuff and I don't want to have to install all the same dependencies in a different project or whatever and I don't want to mess up the other files that I have in my project and then I can mess around with things and I do this a lot for interacting with third-party APIs, I'm just trying to learn about like what's the code that I need to write to consume?

This API and transform it into whatever I need it to be and then forward that on to the rest of my my code base and and then adding types to it and everything and so yeah just having the ability to quickly create little files that will be ignored by git is really quite useful and and files within the project so I can import other files and things and if I want to write it all in typescript then I can use TS node to run it but normally I just do it in JavaScript because often script.

Just kind of in the way there especially since I configure type script to be unstrict mode and everything I'm just rapidly iterating over some code and then when I'm all done with that, I can copy it into where it should be in my project and add types to it and everything like that so anyway.

I think that it can be useful to have a little kind of a playground sort of area for you to to experiment with different ideas and stuff if you want to take it to the next level there's quokka by Wallaby JS and I do have quokka and I use that sometimes but what I'm interacting with third-party APIs, I want.

To be explicit about when I'm rerunning the code and so yeah having just a separate file for that can be quite useful. I've done this for years and maybe that'll be interesting or useful to you hope you have a great day bye.