Cookie Consent by Free Privacy Policy Generator ๐Ÿ“Œ Advent of Code Automation for Javascript/Typescript

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š Advent of Code Automation for Javascript/Typescript


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: dev.to

December means Advent of Code for many of us ๐ŸŽ„ (or at least, the first few days of December)

These funny challenges require a few steps every day, from setting up the new empty solution files to manually downloading the inputs and submitting the solution.

What if the manual/repetitive steps could be automated? ๐Ÿค” It's a game made by developers for developers (developers developers) and depending on your language there are some so-called runners to give some automation ๐Ÿค–

aocrunner

This one I found last year (and I'm using again this year) is designed if you're playing the challenge with both Javascript or Typescript.

This is the original repo: https://github.com/caderek/aocrunner

Tool features

I mean... what do you even need to automate? The game isn't just getting the input and running a js/ts file?

Yeah, but we love automating things, so here's what this tool does:

  • Define a common template to handle the input file and both solutions
  • Create the folder with the files you need for the challenge
  • Download the input file
  • Run the solution locally
  • Submit the solution

You can also quickly run some custom tests and other nice to have features.

I recorded a demo where I show it in action, you can find it here or on YouTube:

Here below you can find all the main steps anyway, in case you don't want to watch the video :)

How to use it

Basically a command lets you create the initial project with some other handy features in the scripts section of the package.json file.

Setup

As written in the README, you can run a command that will create a folder containing all the files you need for the challenge:

npx aocrunner init

A simple CLI installer will ask you for some questions (like the year, js/ts, folder name, etc) and then it will create the folder with the files.

Setup the session cookie

All inputs are different for each user, which means you need somehow to authenticate to the website to download the input file.

Everything happens under the hood, all you need to do is to feed the tool with your session cookie, which you can find in the browser from the "Application" tab of the dev tools.

Put it inside the .env file in the root of the project and that's it! (In the video I show it step by step)

Play a day!

To run the challenges for a day, you can use the run command:

npm run start 1

If it's the first time you run it, it will download the input file and create the js/ts file to run the solution in a new folder.

Otherwise, it will just run & watch the solution to evaluate the result every time you save the file.

Submit the solution

While you're running it with the run command, you can also submit the solution by pressing s in the terminal.

Conclusion

There are also some other features I'd recommend you to try, but one thing it's also worth mentioning is that unfortunately the original project seems inactive.

It works fine so I'm happy to talk about it, but if you're using other runners or you made one, feel free to share it in the comments below!

Happy Advent of Code! ๐ŸŽ„

Thanks for reading this article, I hope you found it interesting!

I recently launched my Discord server to talk about Open Source and Web Development, feel free to join: https://discord.gg/bqwyEa6We6

Do you like my content? You might consider subscribing to my YouTube channel! It means a lot to me โค๏ธ
You can find it here:
YouTube

Feel free to follow me to get notified when new articles are out ;)

...



๐Ÿ“Œ Advent of Code Automation for Javascript/Typescript


๐Ÿ“ˆ 47.7 Punkte

๐Ÿ“Œ How Types Work in TypeScript โ€“ Explained with JavaScript + TypeScript Code


๐Ÿ“ˆ 34.86 Punkte

๐Ÿ“Œ Advent, Advent: Hey Santa, hey Santa


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Aufregung um Tweet vonย Greta Thunberg: Advent, Advent, das Internet brennt


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Advent, Advent: Jingle Bells, Gaming Elfs


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ โ€žAdvent, Advent, ein Lichtlein brenntโ€œ: Vorweihnachtliche Stimmung fรผr jedes Zuhause


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Der gute Ton: Advent, Advent, der Adventkranz brennt


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Lesetipps vom 11.12.2022: Advent, Advent, die Sicherung brennt!


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Advent, Advent โ€“ kein Lichtlein brennt?


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Getting Started with TypeScript: A Quick Introduction From JavaScript to TypeScript!


๐Ÿ“ˆ 30.99 Punkte

๐Ÿ“Œ Advent of Typescript 2023 Day 21 : TIC TAC TOE


๐Ÿ“ˆ 27.81 Punkte

๐Ÿ“Œ Advent of typescript 2023 day 22 : Reindeer Sudoku


๐Ÿ“ˆ 27.81 Punkte

๐Ÿ“Œ Advent of typescript 2023 day 23 : Connect 4


๐Ÿ“ˆ 27.81 Punkte

๐Ÿ“Œ I made "TypeScript Swagger Editor", new type of Swagger UI writing TypeScript code in the browser


๐Ÿ“ˆ 27.49 Punkte

๐Ÿ“Œ Advent of Code en JavaScript Chile


๐Ÿ“ˆ 27.24 Punkte

๐Ÿ“Œ Top 13 Reasons Why Your Test Automation Fails | Automation Testing Tutorial | Automation Tester


๐Ÿ“ˆ 25.94 Punkte

๐Ÿ“Œ 10 typescript developers you must follow to become typescript expert in 2024


๐Ÿ“ˆ 23.61 Punkte

๐Ÿ“Œ Introduction to TypeScript โ€” What is TypeScript?


๐Ÿ“ˆ 23.61 Punkte

๐Ÿ“Œ Learn to Code a BuzzFeed Clone in Three Ways (JavaScript, React, TypeScript)


๐Ÿ“ˆ 23.05 Punkte

๐Ÿ“Œ Learn how to document JavaScript/TypeScript code using JSDoc & Typedoc


๐Ÿ“ˆ 23.05 Punkte

๐Ÿ“Œ Quokka Playground - Run JavaScript and TypeScript in VS Code


๐Ÿ“ˆ 23.05 Punkte

๐Ÿ“Œ HPR2973: Introduction to Advent of Code


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ Advent of Code: Behind the Scenes (Programming Puzzles)


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ Lesetipps: Brustkrebs und Nazis, Advent of Code 2020, Microsoft Patente


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ Advent of Code 2017


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ 2022 Advent Code Challenges


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ Advent of Code - Day 1


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ Discussรฃo sobre o Advent of Code 2022 - Dia 2: Sequรชncia de condiรงรตes


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ The 'Advent of Code 2020' Event Begins


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ Advent of Code - Day 2


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ Advent of Code 2022 Day 2


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ Advent of Code 2022


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ Advent of Code Day 4


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ Day 4 Solutions Advent of Code


๐Ÿ“ˆ 19.87 Punkte

๐Ÿ“Œ Advent of Code 2022 Day 1


๐Ÿ“ˆ 19.87 Punkte











matomo