This is an update on my old "Colourful Cheatsheet Template". It is based on the old one, so similar but not the same.
It still supports all the old visualization features and code listings using tcolorbox / minted. Just input the language you want (and that is supported by minted) in the codebox environment.
However, the style now is a bit less bright and mimicks the Metropolis beamer template in style (a bit).
This is the blogpost to go with it: https://latex-ninja.com/2021/10/01/a-new-version-of-the-colourful-cheatsheet-template/

This is an example illustating how to typeset code in LaTeX, especially in beamer presentations. It uses the metropolis theme.
It is a presentation with one slide per "technique" which include some explanatory comments.
Examples shown are minted, lstlisting, verbatim, tcolorbox and knitR. The main document has the ending ".Rtex" which is required if you want it to be able to run knitR. Otherwise, you can just use normal ".tex".
It is accompanied by a blog post with more information here.
In this blog post, some complications which can arise when using code listings in beamer are discussed (package clashes, etc.), so this might be informative if you want to learn more.

We study Logarithmically Spiral Trajectories and, in particular, we look for a solution to minimize the transit time of a Spacecraft propelled by a Solar Sail, while simultaneously minimizing the area of the Solar Sail, which would allow us to carry more payload on board. We start by analyzing the forces that act on the Spacecraft taking into account that its propellant is a Solar Sail; we use the studied forces to deduce the motion equations. We then solve this motion equation with a Runge-Kutta 4 method and transform the problem of minimizing time and area to a Non-linear Optimization problem. When solving the NLP we also try to minimize the relative final speed of th spacecraft with the destination planet in order to guarantee the possibility of a safe landing on its surface. The model improves when an angle parameter α (describing the angle formed by the Solar Sail with the colliding photons) is defined as a piecewise constant function and optimized whose values are optimized in every interval to minimize transit time and Area. Using the developed model to optimize the trajectory to be followed for sending from Earth to Mars a 2000kg-spacecraft propelled by a Solar Sail, subject to the condition that at trajectory start Mars and Earth were at their closest approach, and the Arrival Relative Velocity is less than 9km/s, give us a minimal transit time of 500days and a minimal area for the Solar Sail of 183158m2, meaning that the maximal payload would be 718kg. Compared with different number of partitions of α, the optimum stays stable. This gives a solid optimal trajectory and a great result for the numerical method used. Actually, waiting until the best moment to throw the Spacecraft, id est, Mars is at 1.14 radians respectively to Earth initial position, the minimal sail area 145950 m2 and, therefore, ables to transport until 978 kg of payload with the same transit time. In addition and to conclude we tried the model to optimize the inverse trajectory.

Marco Praderio Bova, Eneko Martin Martinez, & Maria dels Àngels Guinovart Llort

Ejemplo de uso del archivo arduino_code.tex que define el comando ArduinoSketch y el ambiente ArduinoSketchBox para incluir código arduino en documento LaTeX utilizando el resaltado de sintaxis propio de Arduino IDE

Exemple de rapport pour les TIPE (Travaux d'Initiative Personnelle Encadrés) pour les concours d'entrée aux écoles d'ingénieurs à partir de la session 2017.
Il y a surtout des exemples sur les différentes manières de composer des équations ainsi que comment introduire des portions de code Python pour illustrer son propos.
NB: le script TeXcount pourra vous être utile car il permet de compter les mots utilisés dans chaque section d'un document LaTeX. Vous en trouverez une version en ligne à l'adresse
http://app.uio.no/ifi/texcount/online.php
Il suffit d'y copier l'ensemble du document (via Ctrl-A/Ctrl-C puis Ctrl-V dans la fenêtre idoine) pour obtenir le récapitulatif tout en bas de la page qui s'ouvre alors.
(You can also get the word count in Overleaf by clicking on "Word Count" at the top of the file list panel.)

An indoor positioning system relying on time difference of arrival measurements of ultrasonic pings from fixed transmitters.
Code available at https://github.com/YingVictor/ultrasonic-positioning

Michael Danielczuk, Andrew Kim, Monica Lu, and Victor Ying