From 55765e71a1eb320a17eecf1ebac08d3ef4c48398 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Wed, 30 Aug 2023 20:45:59 +0200 Subject: [PATCH] Both the EN and NL version of are now generated from the same base latex file --- README.md | 5 +- build.sh | 4 +- cleanup.sh | 1 + en.tex | 17 + main.nl.tex | 292 ------------------ main.tex | 72 ++--- markdown/README.md | 10 +- markdown/{blurb.md => blurb.en.md} | 0 markdown/blurb.nl.md | 11 + .../{automation.md => automation.en.md} | 2 +- markdown/project/automation.nl.md | 16 + .../{car-stereo.md => car-stereo.en.md} | 0 markdown/project/car-stereo.nl.md | 12 + .../project/{pico_p1.md => pico_p1.en.md} | 3 +- markdown/project/pico_p1.nl.md | 14 + markdown/project/{z80.md => z80.en.md} | 0 markdown/project/z80.nl.md | 11 + nl.tex | 16 + tool/Cargo.lock | 42 +++ tool/Cargo.toml | 1 + tool/src/main.rs | 103 +++++- yaml/education.en.yml | 10 + yaml/education.nl.yml | 11 + yaml/experience.en.yml | 11 + yaml/experience.nl.yml | 11 + 25 files changed, 319 insertions(+), 356 deletions(-) create mode 100644 en.tex delete mode 100755 main.nl.tex mode change 100755 => 100644 main.tex rename markdown/{blurb.md => blurb.en.md} (100%) create mode 100644 markdown/blurb.nl.md rename markdown/project/{automation.md => automation.en.md} (82%) create mode 100644 markdown/project/automation.nl.md rename markdown/project/{car-stereo.md => car-stereo.en.md} (100%) create mode 100644 markdown/project/car-stereo.nl.md rename markdown/project/{pico_p1.md => pico_p1.en.md} (84%) create mode 100644 markdown/project/pico_p1.nl.md rename markdown/project/{z80.md => z80.en.md} (100%) create mode 100644 markdown/project/z80.nl.md create mode 100644 nl.tex create mode 100644 yaml/education.en.yml create mode 100644 yaml/education.nl.yml create mode 100644 yaml/experience.en.yml create mode 100644 yaml/experience.nl.yml diff --git a/README.md b/README.md index 0b2eb67..a69018b 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ However since then I have also connected the [ESP32] to the [CAN bus] of my car, ### [Home Automation](https://git.huizinga.dev/Dreaded_X/automation_rs) I have slowly been converting my house into my very own smart home! -It all started with a couple of Philips Hue light bulbs, the Hue app allows for some level of automation but it wasn't quite doing what I wanted. +It all started with a couple of [Philips Hue] light bulbs, the Hue app allows for some level of automation but it wasn't quite doing what I wanted. So initially I wrote a very simple program in [Go] to add my own automations. As I added more smart devices to my house, the program grew massively in scope with things quickly getting hacked in just to make it work. Eventually I decided to rewrite the whole thing in Rust! @@ -42,10 +42,11 @@ This was my first real Rust after picking up the language during [Advent of Code ### [Pico P1](https://git.huizinga.dev/Dreaded_X/pico_p1) This is my most recent project, as I had recently decided to pick up a [Raspberry Pi Pico W] just to play around with. -I decided to build a device to read out my [DSMR5] based smart meter using it's P1 port and publish the information using MQTT. +I decided to build a device to read out my [DSMR5] based smart meter using it's P1 port and publish the information using [MQTT]. The main intention of this project is to learn about Rust for embedded devices, which is still a very new ecosystem. So far it has been quite a nice experience! [Raspberry Pi Pico W]: https://en.wikipedia.org/wiki/Raspberry_Pi#Raspberry_Pi_Pico [DSMR5]: https://www.netbeheernederland.nl/_upload/Files/Slimme_meter_15_a727fce1f1.pdf +[MQTT]: https://nl.wikipedia.org/wiki/MQTT diff --git a/build.sh b/build.sh index b946591..aeb5aac 100755 --- a/build.sh +++ b/build.sh @@ -1,2 +1,4 @@ #!/bin/bash -cd tool && cargo run && cd .. && latexmk -shell-escape -lualatex +cd tool && cargo run && cd .. +latexmk -shell-escape -lualatex main.en.tex +latexmk -shell-escape -lualatex main.nl.tex diff --git a/cleanup.sh b/cleanup.sh index cb5a363..3985937 100755 --- a/cleanup.sh +++ b/cleanup.sh @@ -5,6 +5,7 @@ find . -name "*.fls" | xargs rm -rf find . -name "*.log" | xargs rm -rf find . -name "*.markdown.in" | xargs rm -rf find . -name "*.out" | xargs rm -rf +find . -name "main.*.tex" | xargs rm -rf rm -rf svg-inkscape rm -rf _markdown_* rm -rf latex diff --git a/en.tex b/en.tex new file mode 100644 index 0000000..67745a7 --- /dev/null +++ b/en.tex @@ -0,0 +1,17 @@ +\newcommand{\WhoAmI}{Who Am I?} +\newcommand{\Experience}{Experience} +\newcommand{\Education}{Education} +\newcommand{\ProgrammingLanguages}{Programming Languages} +\newcommand{\OtherSkills}{Other Skills} +\newcommand{\Languages}{Languages} +\newcommand{\Projects}{Projects} + +\newcommand{\Now}{Now} + +\newcommand{\Dutch}{Dutch} +\newcommand{\English}{English} + +\newcommand{\Maths}{Maths} +\newcommand{\Physics}{Physics} +\newcommand{\Soldering}{Soldering} + diff --git a/main.nl.tex b/main.nl.tex deleted file mode 100755 index 1a06eef..0000000 --- a/main.nl.tex +++ /dev/null @@ -1,292 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Developer CV -% LaTeX Template -% Version 1.0 (28/1/19) -% -% This template originates from: -% http://www.LaTeXTemplates.com -% -% Authors: -% Jan Vorisek (jan@vorisek.me) -% Based on a template by Jan Küster (info@jankuester.com) -% Modified for LaTeX Templates by Vel (vel@LaTeXTemplates.com) -% -% License: -% The MIT License (see included LICENSE file) -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% https://www.latextemplates.com/template/developer-cv - -%---------------------------------------------------------------------------------------- -% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS -%---------------------------------------------------------------------------------------- - -\documentclass[9pt]{developercv} % Default font size, values from 8-12pt are recommended - -\usepackage{svg} -\usepackage{xurl} -\usepackage{markdown} -\markdownSetup{ - renderers = { - link = {% - #1% - % TODO: For some reason _ in url turn in _{} - % \href{#2}{#1}% - }, - }, -} - -%---------------------------------------------------------------------------------------- - -\begin{document} - -% File containing somewhat private information, not checked into the repository -\input{latex/private.tex} - -%---------------------------------------------------------------------------------------- -% TITLE AND CONTACT INFORMATION -%---------------------------------------------------------------------------------------- - -\begin{minipage}[t]{0.45\textwidth} % 45% of the page width for name - \vspace{-\baselineskip} % Required for vertically aligning minipages - - % If your name is very short, use just one of the lines below - % If your name is very long, reduce the font size or make the minipage wider and reduce the others proportionately - \colorbox{black}{{\HUGE\textcolor{white}{\texttt{\textbf{\MakeUppercase{Tim}}}}}} % First name - - \colorbox{black}{{\HUGE\textcolor{white}{\texttt{\textbf{\MakeUppercase{Huizinga}}}}}} % Last name - - \vspace{6pt} - - {\huge Applied Physics Student} % Career or current job title -\end{minipage} -\begin{minipage}[t]{0.275\textwidth} % 27.5% of the page width for the first row of icons - \vspace{-\baselineskip} % Required for vertically aligning minipages - - % The first parameter is the FontAwesome icon name, the second is the box size and the third is the text - % Other icons can be found by referring to fontawesome.pdf (supplied with the template) and using the word after \fa in the command for the icon you want - \icon{\faMapMarker*}{12}{Delft}\\ - \icon{\faPhone*}{12}{\phone}\\ - \icon{\faAt}{12}{\href{mailto:\email}{\texttt{\email}}}\\ -\end{minipage} -\begin{minipage}[t]{0.275\textwidth} % 27.5% of the page width for the second row of icons - \vspace{-\baselineskip} % Required for vertically aligning minipages - - % The first parameter is the FontAwesome icon name, the second is the box size and the third is the text - % Other icons can be found by referring to fontawesome.pdf (supplied with the template) and using the word after \fa in the command for the icon you want - \icon{\faGlobe}{12}{\href{https://huizinga.dev}{\texttt{huizinga.dev}}}\\ - \icon{\faGithub}{12}{\href{https://github.com/DreadedX}{\texttt{github.com/DreadedX}}}\\ - \icon{\faGit}{12}{\href{https://git.huizinga.dev/explore}{\texttt{git.huizinga.dev}}}\\ -\end{minipage} - -\vspace{0.5cm} - -%---------------------------------------------------------------------------------------- -% INTRODUCTION -%---------------------------------------------------------------------------------------- - -\cvsect{Wie ben ik?} - -\begin{minipage}[t]{1\textwidth} % 40% of the page width for the introduction text - \vspace{-\baselineskip} % Required for vertically aligning minipages - - Een Applied Physics student met aan passie voor programeren! - - Ik heb het altijd leuk gevonden om te programeren als hobby, en wil er graag mijn baan van maken. - Tegenwoordig gaat deze hobby ook vaak samen met de hardware kant. - Recent ben ik ook begonnen met het programeren in Rust, en het is snel mijn favoriete programeer taal geworden. - - Daarnaast heb ik ook veel ervaring met Linux, ik gebruik het al bij 10 jaar als mijn daily driver. - Hierdoor ben ik erg bekend met de command line en de verschillende tools die daar beschikbaar zijn. - Ik draai zelfs al enige tijd mijn eigen Linux server thuis! - -\end{minipage} - -%---------------------------------------------------------------------------------------- -% EXPERIENCE -%---------------------------------------------------------------------------------------- - -\cvsect{Ervaring} - -\begin{entrylist} - \entry - {2019} - {App Developer} - {EOCE} - {Ik heb een interne Android app ontwikkeld voor het kalibreren van temperatuur sensoren.} - \entry - {2018 -- 2019} - {Student Assistent} - {TU Delft} - {Ik hielp andere studenten als zij vragen hadden tijdens de werkcolleges voor het vak Elektromagnetisme.} -\end{entrylist} - -%---------------------------------------------------------------------------------------- -% EDUCATION -%---------------------------------------------------------------------------------------- - -\cvsect{Opleiding} - -\begin{entrylist} - \entry - {2019 -- Now} - {MSc} - {TU Delft} - {Applied Physics met een focus op Quantum Computation.} - \entry - {2016 -- 2019} - {BSc} - {TU Delft} - {Technische Natuurkunde met een minor in Electronics for Robotics.} -\end{entrylist} - -%---------------------------------------------------------------------------------------- -% ADDITIONAL INFORMATION -%---------------------------------------------------------------------------------------- - -\begin{minipage}[t]{0.18\textwidth} - \vspace{-\baselineskip} % Required for vertically aligning minipages - - \cvsect{Programeertalen} - - \iconsvg{rust}{12}{Rust}\\ - \hfill - \iconsvg{c}{12}{C}\\ - \hfill - \iconsvg{javascript}{12}{JavaScript}\\ - \hfill - \iconsvg{python}{12}{Python}\\ - \hfill - \iconsvg{java}{12}{Java}\\ - \hfill - \iconsvg{csharp}{12}{C\#}\\ -\end{minipage} -\begin{minipage}[t]{0.18\textwidth} - \vspace{-\baselineskip} % Required for vertically aligning minipages - \vspace{32.35pt} % Make sure it lines up with the rest - - \iconsvg{cpp}{12}{C++}\\ - \hfill - \iconsvg{go}{12}{Go}\\ - \hfill - \iconsvg{typescript}{12}{TypeScript}\\ - \hfill - \iconsvg{lua}{12}{Lua}\\ - \hfill - \iconsvg{kotlin}{12}{Kotlin}\\ - \hfill - \iconempty{12}{Verilog}\\ -\end{minipage} -\hfill -\begin{minipage}[t]{0.18\textwidth} - \vspace{-\baselineskip} % Required for vertically aligning minipages - - \cvsect{Andere vaardigheden} - - \icon{\faCalculator}{12}{Wiskunde}\\ - \hfill - \iconsvg{linux}{12}{Linux}\\ - \hfill - \iconsvg{git}{12}{Git}\\ - \hfill - \iconsvg{android}{12}{Android Dev}\\ - \hfill - \iconempty{12}{PCB Design}\\ -\end{minipage} -\begin{minipage}[t]{0.18\textwidth} - \vspace{-\baselineskip} % Required for vertically aligning minipages - \vspace{32.35pt} % Make sure it lines up with the rest - - \icon{\faApple*}{12}{Natuurkunde}\\ - \hfill - \iconsvg{bash}{12}{Bash}\\ - \hfill - \iconsvg{docker}{12}{Docker}\\ - \hfill - \icon{\faMicrochip}{12}{Embedded}\\ - \hfill - \iconempty{12}{Solderen}\\ -\end{minipage} -\hfill -\begin{minipage}[t]{0.18\textwidth} - \vspace{-\baselineskip} % Required for vertically aligning minipages - - \cvsect{Talen} - - \textbf{Nederlands} - native \\ - \textbf{Engels} - near native -\end{minipage} - -%---------------------------------------------------------------------------------------- -% PROJECTS -%---------------------------------------------------------------------------------------- - -\clearpage -\begin{minipage}[t]{1\textwidth} - \vspace{-\baselineskip} % Required for vertically aligning minipages - - \colorbox{black}{{\Huge\textcolor{white}{\textbf{\MakeUppercase{Projecten}}}}} -\end{minipage} - -\vspace{8pt} - -\begin{minipage}[t]{0.3\textwidth} - \vspace{-\baselineskip} % Required for vertically aligning minipages - \cvsect{Z80 Computer} - - Een van mijn eerste grote hardware projecten was een computer ontwerpen rondom the de Z80 microprocessor. - Hiervoor moest ik een groot aantal nieuwe vaardigheden leren, waaronder het ontwerpen van PCB's, programeren in Assembly, werken met FPGA's en leren omgaan met een oscilloscope. - - \vspace{3pt} - - \rurl{git.huizinga.dev/Z80/Z80} - - \vspace{6pt} - - \cvsect{Pico P1} - - Dit is mijn meest recente project, ik had recent een Raspberry Pi Pico W gekocht om mee rond te spelen. - Uiteindelijk heb ik besloten een apparaat te maken om mijn DSMR5 slimme meter uit te lezen via de P1 en deze informatie vervolgen via MQTT te delen. - Het doel van dit project was vooral om ervaring op te doen met Rust voor embedded devices, een ecosystem dat nog volop in ontwikkeling is momenteel. - Tot nu toe is dit een hele goede ervaring geweest. - - \vspace{3pt} - - \rurl{git.huizinga.dev/Dreaded_X/pico_p1} -\end{minipage} -\hfill -\begin{minipage}[t]{0.3\textwidth} - \vspace{-\baselineskip} % Required for vertically aligning minipages - \cvsect{Car Stereo} - - Mijn Peugeot 207 heeft alleen bluetooth voor bellen, dus het leek mijn leuk om mijn eigen bluetooth ontvanger to bouwen met een ESP32 microcontroller. - Oorspronkelijk was het doel om gewoon een onvanger to bouwen en deze aan te sluiten op de aux port in het dashboardkastje, maar uiteindelijk is het project toch iets complexer geworden. - Het is namelijk nu ook mogelijk om de muziek de bedienen via de knoppen op mijn stuur, dit komt omdat ik de ESP32 aangesloten heb op de CAN bus van mijn auto. - - \vspace{3pt} - - \rurl{git.huizinga.dev/Dreaded_X/car-stereo} -\end{minipage} -\hfill -\begin{minipage}[t]{0.3\textwidth} - \vspace{-\baselineskip} % Required for vertically aligning minipages - \cvsect{Home Automation} - - Ik ben langzaam aan bezig om mijn huis om te toveren in een smart home! - Het begon allemaal met een aantal Philips Hue lampen, doormiddel van de Hue app is wel wat mogelijk voor automatisering, maar niet precies wat ik wilde. - Dus in de eerste instantie had ik een heel simpel programma geschreven in Go om zo mijn eigen automatiseringen mogelijk te maken. - Maar naarmate ik meer smart devices toevoegde aan mijn huis werd dit programma steeds complexer, vooral omdat ik alles er een beetje in moest hacken om het werkend te krijgen. - Uitendelijk heb ik er voor gekozen om het helemaal opnieuw te bouwen in Rust! - Dit was mijn eerste echte project met Rust nadat ik het begonnen was met leren tijdens Advent of Code en het was (en is nog steeds) een heel leerzaam project. - - \vspace{3pt} - - \rurl{git.huizinga.dev/Dreaded_X/automation_rs} -\end{minipage} -\hfill -\begin{minipage}[t]{0.3\textwidth} -\end{minipage} - -%---------------------------------------------------------------------------------------- - -\end{document} diff --git a/main.tex b/main.tex old mode 100755 new mode 100644 index e41643c..fd9ae2c --- a/main.tex +++ b/main.tex @@ -40,8 +40,7 @@ \begin{document} -% File containing somewhat private information, not checked into the repository -\input{latex/private.tex} +\input{{{lang}}.tex} %---------------------------------------------------------------------------------------- % TITLE AND CONTACT INFORMATION @@ -65,9 +64,16 @@ % The first parameter is the FontAwesome icon name, the second is the box size and the third is the text % Other icons can be found by referring to fontawesome.pdf (supplied with the template) and using the word after \fa in the command for the icon you want - \icon{\faMapMarker*}{12}{Delft}\\ - \icon{\faPhone*}{12}{\phone}\\ - \icon{\faAt}{12}{\href{mailto:\email}{\texttt{\email}}}\\ + \IfFileExists{latex/private.tex}{ + % File containing somewhat private information, not checked into the repository + \input{latex/private.tex} + + \icon{\faMapMarker*}{12}{\City}\\ + \icon{\faPhone*}{12}{\Phone}\\ + \icon{\faAt}{12}{\href{mailto:\Email}{\texttt{\Email}}}\\ + }{ + \hfill + } \end{minipage} \begin{minipage}[t]{0.275\textwidth} % 27.5% of the page width for the second row of icons \vspace{-\baselineskip} % Required for vertically aligning minipages @@ -85,12 +91,12 @@ % INTRODUCTION %---------------------------------------------------------------------------------------- -\cvsect{Who Am I?} +\cvsect{\WhoAmI} \begin{minipage}[t]{1\textwidth} % 40% of the page width for the introduction text \vspace{-\baselineskip} % Required for vertically aligning minipages - \input{latex/blurb.tex} + \input{latex/blurb.{{lang}}.md.tex} \end{minipage} @@ -98,38 +104,20 @@ % EXPERIENCE %---------------------------------------------------------------------------------------- -\cvsect{Experience} +\cvsect{\Experience} \begin{entrylist} - \entry - {2019} - {App Developer} - {EOCE} - {I developed in internal Android app to aid in the calibration of temperature sensors.} - \entry - {2018 -- 2019} - {Teaching Assistant} - {Delft University of Technology} - {I helped others students if they had questions during tutorial sessions for the course Electromagnetism.} + \input{latex/experience.{{lang}}.yml.tex} \end{entrylist} %---------------------------------------------------------------------------------------- % EDUCATION %---------------------------------------------------------------------------------------- -\cvsect{Education} +\cvsect{\Education} \begin{entrylist} - \entry - {2019 -- Now} - {MSc} - {Delft University of Technology} - {Applied Physics with a focus on Quantum Computation.} - \entry - {2016 -- 2019} - {BSc} - {Delft University of Technology} - {Applied Physics with a minor in Electronics for Robotics.} + \input{latex/education.{{lang}}.yml.tex} \end{entrylist} %---------------------------------------------------------------------------------------- @@ -139,7 +127,7 @@ \begin{minipage}[t]{0.18\textwidth} \vspace{-\baselineskip} % Required for vertically aligning minipages - \cvsect{Programming languages} + \cvsect{\ProgrammingLanguages} \iconsvg{rust}{12}{Rust}\\ \hfill @@ -173,9 +161,9 @@ \begin{minipage}[t]{0.18\textwidth} \vspace{-\baselineskip} % Required for vertically aligning minipages - \cvsect{Other skills} + \cvsect{\OtherSkills} - \icon{\faCalculator}{12}{Maths}\\ + \icon{\faCalculator}{12}{\Maths}\\ \hfill \iconsvg{linux}{12}{Linux}\\ \hfill @@ -189,7 +177,7 @@ \vspace{-\baselineskip} % Required for vertically aligning minipages \vspace{32.35pt} % Make sure it lines up with the rest - \icon{\faApple*}{12}{Physics}\\ + \icon{\faApple*}{12}{\Physics}\\ \hfill \iconsvg{bash}{12}{Bash}\\ \hfill @@ -197,16 +185,16 @@ \hfill \icon{\faMicrochip}{12}{Embedded}\\ \hfill - \iconempty{12}{Soldering}\\ + \iconempty{12}{\Soldering}\\ \end{minipage} \hfill \begin{minipage}[t]{0.18\textwidth} \vspace{-\baselineskip} % Required for vertically aligning minipages - \cvsect{Languages} + \cvsect{\Languages} - \textbf{Dutch} - native\\ - \textbf{English} - near native + \textbf{\Dutch} - native\\ + \textbf{\English} - near native \end{minipage} %---------------------------------------------------------------------------------------- @@ -217,26 +205,26 @@ \begin{minipage}[t]{1\textwidth} \vspace{-\baselineskip} % Required for vertically aligning minipages - \colorbox{black}{{\Huge\textcolor{white}{\textbf{\MakeUppercase{Projects}}}}} + \colorbox{black}{{\Huge\textcolor{white}{\textbf{\MakeUppercase{\Projects}}}}} \end{minipage} \vspace{8pt} \begin{minipage}[t]{0.3\textwidth} \vspace{-\baselineskip} % Required for vertically aligning minipages - \input{latex/project/z80.tex} + \input{latex/project/z80.{{lang}}.md.tex} \vspace{6pt} - \input{latex/project/pico_p1.tex} + \input{latex/project/pico_p1.{{lang}}.md.tex} \end{minipage} \hfill \begin{minipage}[t]{0.3\textwidth} \vspace{-\baselineskip} % Required for vertically aligning minipages - \input{latex/project/car-stereo.tex} + \input{latex/project/car-stereo.{{lang}}.md.tex} \end{minipage} \hfill \begin{minipage}[t]{0.3\textwidth} \vspace{-\baselineskip} % Required for vertically aligning minipages - \input{latex/project/automation.tex} + \input{latex/project/automation.{{lang}}.md.tex} \end{minipage} \hfill \begin{minipage}[t]{0.3\textwidth} diff --git a/markdown/README.md b/markdown/README.md index bae741c..c8b9936 100644 --- a/markdown/README.md +++ b/markdown/README.md @@ -1,8 +1,8 @@ # Hi! I'm Tim Huizinga -#{blurb.md} +#{blurb.en.md} ## Projects -#{project/z80.md} -#{project/car-stereo.md} -#{project/automation.md} -#{project/pico_p1.md} +#{project/z80.en.md} +#{project/car-stereo.en.md} +#{project/automation.en.md} +#{project/pico_p1.en.md} diff --git a/markdown/blurb.md b/markdown/blurb.en.md similarity index 100% rename from markdown/blurb.md rename to markdown/blurb.en.md diff --git a/markdown/blurb.nl.md b/markdown/blurb.nl.md new file mode 100644 index 0000000..c8026cc --- /dev/null +++ b/markdown/blurb.nl.md @@ -0,0 +1,11 @@ +Een Applied Physics student met aan passie voor programeren! + +Ik heb het altijd leuk gevonden om te programeren als hobby, en wil er graag mijn baan van maken. +Tegenwoordig gaat deze hobby ook vaak samen met de hardware kant. +Recent ben ik ook begonnen met het programeren in [Rust], en het is snel mijn favoriete programeer taal geworden. + +Daarnaast heb ik ook veel ervaring met Linux, ik gebruik het al bij 10 jaar als mijn daily driver. +Hierdoor ben ik erg bekend met de command line en de verschillende tools die daar beschikbaar zijn. +Ik draai zelfs al enige tijd mijn eigen Linux server thuis! + +[Rust]: https://rust-lang.org diff --git a/markdown/project/automation.md b/markdown/project/automation.en.md similarity index 82% rename from markdown/project/automation.md rename to markdown/project/automation.en.md index 7caec11..88b7f99 100644 --- a/markdown/project/automation.md +++ b/markdown/project/automation.en.md @@ -5,7 +5,7 @@ project: --- I have slowly been converting my house into my very own smart home! -It all started with a couple of Philips Hue light bulbs, the Hue app allows for some level of automation but it wasn't quite doing what I wanted. +It all started with a couple of [Philips Hue] light bulbs, the Hue app allows for some level of automation but it wasn't quite doing what I wanted. So initially I wrote a very simple program in [Go] to add my own automations. As I added more smart devices to my house, the program grew massively in scope with things quickly getting hacked in just to make it work. Eventually I decided to rewrite the whole thing in Rust! diff --git a/markdown/project/automation.nl.md b/markdown/project/automation.nl.md new file mode 100644 index 0000000..75df507 --- /dev/null +++ b/markdown/project/automation.nl.md @@ -0,0 +1,16 @@ +--- +project: + url: git.huizinga.dev/Dreaded_X/automation_rs + title: Home Automation +--- + +Ik ben langzaam aan bezig om mijn huis om te toveren in een smart home! +Het begon allemaal met een aantal [Philips Hue] lampen, doormiddel van de Hue app is wel wat mogelijk voor automatisering, maar niet precies wat ik wilde. +Dus in de eerste instantie had ik een heel simpel programma geschreven in [Go] om zo mijn eigen automatiseringen mogelijk te maken. +Maar naarmate ik meer smart devices toevoegde aan mijn huis werd dit programma steeds complexer, vooral omdat ik alles er een beetje in moest hacken om het werkend te krijgen. +Uitendelijk heb ik er voor gekozen om het helemaal opnieuw te bouwen in [Rust]! +Dit was mijn eerste echte project met Rust nadat ik het begonnen was met leren tijdens Advent of Code en het was (en is nog steeds) een heel leerzaam project. + +[Philips Hue]: https://nl.wikipedia.org/wiki/Philips_Hue +[Go]: https://go.dev +[Advent of Code]: https://adventofcode.com/ diff --git a/markdown/project/car-stereo.md b/markdown/project/car-stereo.en.md similarity index 100% rename from markdown/project/car-stereo.md rename to markdown/project/car-stereo.en.md diff --git a/markdown/project/car-stereo.nl.md b/markdown/project/car-stereo.nl.md new file mode 100644 index 0000000..79b8fed --- /dev/null +++ b/markdown/project/car-stereo.nl.md @@ -0,0 +1,12 @@ +--- +project: + url: git.huizinga.dev/Dreaded_X/car-stereo + title: Car Stereo +--- + +Mijn Peugeot 207 heeft alleen bluetooth voor bellen, dus het leek mijn leuk om mijn eigen bluetooth ontvanger to bouwen met een [ESP32] microcontroller. +Oorspronkelijk was het doel om gewoon een onvanger to bouwen en deze aan te sluiten op de aux port in het dashboardkastje, maar uiteindelijk is het project toch iets complexer geworden. +Het is namelijk nu ook mogelijk om de muziek de bedienen via de knoppen op mijn stuur, dit komt omdat ik de [ESP32] aangesloten heb op de [CAN bus] van mijn auto. + +[ESP32]: https://en.wikipedia.org/wiki/ESP32 +[CAN bus]: https://en.wikipedia.org/wiki/CAN_bus diff --git a/markdown/project/pico_p1.md b/markdown/project/pico_p1.en.md similarity index 84% rename from markdown/project/pico_p1.md rename to markdown/project/pico_p1.en.md index 4f01074..e03637a 100644 --- a/markdown/project/pico_p1.md +++ b/markdown/project/pico_p1.en.md @@ -5,9 +5,10 @@ project: --- This is my most recent project, as I had recently decided to pick up a [Raspberry Pi Pico W] just to play around with. -I decided to build a device to read out my [DSMR5] based smart meter using it's P1 port and publish the information using MQTT. +I decided to build a device to read out my [DSMR5] based smart meter using it's P1 port and publish the information using [MQTT]. The main intention of this project is to learn about Rust for embedded devices, which is still a very new ecosystem. So far it has been quite a nice experience! [Raspberry Pi Pico W]: https://en.wikipedia.org/wiki/Raspberry_Pi#Raspberry_Pi_Pico [DSMR5]: https://www.netbeheernederland.nl/_upload/Files/Slimme_meter_15_a727fce1f1.pdf +[MQTT]: https://nl.wikipedia.org/wiki/MQTT diff --git a/markdown/project/pico_p1.nl.md b/markdown/project/pico_p1.nl.md new file mode 100644 index 0000000..fbf28be --- /dev/null +++ b/markdown/project/pico_p1.nl.md @@ -0,0 +1,14 @@ +--- +project: + url: git.huizinga.dev/Dreaded_X/pico_p1 + title: Pico P1 +--- + +Dit is mijn meest recente project, ik had recent een [Raspberry Pi Pico W] gekocht om mee rond te spelen. +Uiteindelijk heb ik besloten een apparaat te maken om mijn [DSMR5] slimme meter uit te lezen via de P1 en deze informatie vervolgen via [MQTT] te delen. +Het doel van dit project was vooral om ervaring op te doen met Rust voor embedded devices, een ecosystem dat nog volop in ontwikkeling is momenteel. +Tot nu toe is dit een hele goede ervaring geweest. + +[Raspberry Pi Pico W]: https://en.wikipedia.org/wiki/Raspberry_Pi#Raspberry_Pi_Pico +[DSMR5]: https://www.netbeheernederland.nl/_upload/Files/Slimme_meter_15_a727fce1f1.pdf +[MQTT]: https://nl.wikipedia.org/wiki/MQTT diff --git a/markdown/project/z80.md b/markdown/project/z80.en.md similarity index 100% rename from markdown/project/z80.md rename to markdown/project/z80.en.md diff --git a/markdown/project/z80.nl.md b/markdown/project/z80.nl.md new file mode 100644 index 0000000..2328b88 --- /dev/null +++ b/markdown/project/z80.nl.md @@ -0,0 +1,11 @@ +--- +project: + url: git.huizinga.dev/Z80/Z80 + title: Z80 Computer +--- + +Een van mijn eerste grote hardware projecten was een computer ontwerpen rondom the de [Z80] microprocessor. +Hiervoor moest ik een groot aantal nieuwe vaardigheden leren, waaronder het ontwerpen van PCB's, programeren in Assembly, werken met [FPGA]'s en leren omgaan met een oscilloscope. + +[Z80]: https://en.wikipedia.org/wiki/Zilog_Z80 +[FPGA]: https://en.wikipeida.org/wiki/Field-programmable_gate_array diff --git a/nl.tex b/nl.tex new file mode 100644 index 0000000..0ca0f4a --- /dev/null +++ b/nl.tex @@ -0,0 +1,16 @@ +\newcommand{\WhoAmI}{Wie ben ik?} +\newcommand{\Experience}{Ervaring} +\newcommand{\Education}{Opleiding} +\newcommand{\ProgrammingLanguages}{Programeertalen} +\newcommand{\OtherSkills}{Andere vaardigheden} +\newcommand{\Languages}{Talen} +\newcommand{\Projects}{Projecten} + +\newcommand{\Now}{Heden} + +\newcommand{\Dutch}{Nederlands} +\newcommand{\English}{Engels} + +\newcommand{\Maths}{Wiskunde} +\newcommand{\Physics}{Natuurkunde} +\newcommand{\Soldering}{Solderen} diff --git a/tool/Cargo.lock b/tool/Cargo.lock index ee52545..c86e4a0 100644 --- a/tool/Cargo.lock +++ b/tool/Cargo.lock @@ -23,6 +23,12 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "gray_matter" version = "0.2.6" @@ -34,6 +40,22 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown", +] + [[package]] name = "itoa" version = "1.0.9" @@ -145,6 +167,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "syn" version = "2.0.29" @@ -165,6 +200,7 @@ dependencies = [ "gray_matter", "regex", "serde", + "serde_yaml", "walkdir", ] @@ -174,6 +210,12 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +[[package]] +name = "unsafe-libyaml" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" + [[package]] name = "walkdir" version = "2.3.3" diff --git a/tool/Cargo.toml b/tool/Cargo.toml index acefaff..007bace 100644 --- a/tool/Cargo.toml +++ b/tool/Cargo.toml @@ -13,4 +13,5 @@ gray_matter = { version = "0.2.6", features = [ ], default-features = false } regex = "1.9.4" serde = { version = "1.0.188", features = ["derive"] } +serde_yaml = "0.9.25" walkdir = "2.3.3" diff --git a/tool/src/main.rs b/tool/src/main.rs index 81ee5ea..6c4d3ff 100644 --- a/tool/src/main.rs +++ b/tool/src/main.rs @@ -9,23 +9,28 @@ use regex::{Captures, Regex}; use serde::Deserialize; use walkdir::WalkDir; -#[derive(Debug, Deserialize)] -#[serde(rename_all = "snake_case")] -enum FrontMatter { - Project { title: String, url: String }, -} - fn main() -> anyhow::Result<()> { dotenvy::dotenv().ok(); - generate_latex()?; + generate_lang("en")?; + generate_lang("nl")?; + + generate_latex_from_md()?; + generate_latex_from_yml()?; + generate_latex_private()?; generate_readme()?; Ok(()) } -fn generate_latex() -> anyhow::Result<()> { +#[derive(Debug, Deserialize)] +#[serde(rename_all = "snake_case")] +enum FrontMatter { + Project { title: String, url: String }, +} + +fn generate_latex_from_md() -> anyhow::Result<()> { let matter = Matter::::new(); let prefix = Path::new("../markdown"); @@ -37,12 +42,12 @@ fn generate_latex() -> anyhow::Result<()> { continue; } - println!("{entry:#?}"); - let mut file = File::open(entry.path()).unwrap(); let mut contents = String::new(); file.read_to_string(&mut contents).unwrap(); + println!("Converting '{entry:?}' into LaTeX"); + let result = matter.parse(&contents); let content = format!( "\\begin{{markdown}}\n{}\n\\end{{markdown}}\n", @@ -62,15 +67,72 @@ fn generate_latex() -> anyhow::Result<()> { content }; - let path = entry.path().strip_prefix(prefix)?.with_extension("tex"); + let path = entry.path().strip_prefix(prefix)?.with_extension("md.tex"); let path = Path::new("../latex").join(path); create_dir_all(path.parent().unwrap())?; let mut file = File::create(path)?; file.write_all(contents.as_bytes())?; } + Ok(()) +} + +#[derive(Debug, Deserialize)] +struct Entry { + name: String, + description: String, + at: String, + start: isize, + end: Option, +} + +fn generate_latex_from_yml() -> anyhow::Result<()> { + let prefix = Path::new("../yaml"); + + for entry in WalkDir::new(prefix).into_iter() { + let entry = entry?; + + if entry.metadata()?.is_dir() { + continue; + } + + let mut file = File::open(entry.path()).unwrap(); + let mut contents = String::new(); + file.read_to_string(&mut contents).unwrap(); + + println!("Converting '{entry:?}' into LaTeX"); + + let data: Vec = serde_yaml::from_str(&contents)?; + + let mut content = String::new(); + for entry in data { + let date = if entry.end.is_none() { + format!("{} -- \\Now", entry.start) + } else if entry.start == entry.end.unwrap() { + format!("{}", entry.start) + } else { + format!("{} -- {}", entry.start, entry.end.unwrap()) + }; + + content = format!( + "{content}\\entry\n\t{{{date}}}\n\t{{{}}}\n\t{{{}}}\n\t{{{}}}\n", + entry.name, entry.at, entry.description + ); + } + + let path = entry.path().strip_prefix(prefix)?.with_extension("yml.tex"); + let path = Path::new("../latex").join(path); + create_dir_all(path.parent().unwrap())?; + let mut file = File::create(path)?; + file.write_all(content.as_bytes())?; + } + + Ok(()) +} + +fn generate_latex_private() -> anyhow::Result<()> { let private = format!( - "\\newcommand{{\\city}}{{{}}}\n\\newcommand{{\\phone}}{{{}}}\n\\newcommand{{\\email}}{{{}}}\n", + "\\newcommand{{\\City}}{{{}}}\n\\newcommand{{\\Phone}}{{{}}}\n\\newcommand{{\\Email}}{{{}}}\n", std::env::var("CITY")?, std::env::var("PHONE")?, std::env::var("EMAIL")?, @@ -118,3 +180,20 @@ fn generate_readme() -> anyhow::Result<()> { Ok(()) } + +fn generate_lang(lang: &str) -> anyhow::Result<()> { + let main = Path::new("../main.tex"); + + let mut file = File::open(main)?; + let mut contents = String::new(); + file.read_to_string(&mut contents)?; + + let contents = contents.replace("{{lang}}", lang); + + let path = main.with_extension(format!("{lang}.tex")); + println!("Generating '{path:?}'"); + let mut file = File::create(path)?; + file.write_all(contents.as_bytes()).unwrap(); + + Ok(()) +} diff --git a/yaml/education.en.yml b/yaml/education.en.yml new file mode 100644 index 0000000..ccd97f7 --- /dev/null +++ b/yaml/education.en.yml @@ -0,0 +1,10 @@ +- name: MSc + description: Applied Physics with a focus on Quantum Computation. + at: Delft University of Technology + start: 2019 + +- name: BSc + description: Applied Physics with a minor in Electronics for Robotics. + at: Delft University of Technology + start: 2016 + end: 2019 diff --git a/yaml/education.nl.yml b/yaml/education.nl.yml new file mode 100644 index 0000000..155203f --- /dev/null +++ b/yaml/education.nl.yml @@ -0,0 +1,11 @@ + +- name: MSc + description: Applied Physics met een focus op Quantum Computation. + at: TU Delft + start: 2019 + +- name: BSc + description: Applied Physics met een minor in Electronics for Robotics. + at: TU Delft + start: 2016 + end: 2019 diff --git a/yaml/experience.en.yml b/yaml/experience.en.yml new file mode 100644 index 0000000..7e7b315 --- /dev/null +++ b/yaml/experience.en.yml @@ -0,0 +1,11 @@ +- name: App Developer + description: I developed in internal Android app to aid in the calibration of temperature sensors. + at: EOCE + start: 2019 + end: 2019 + +- name: Teaching Assistant + description: I helped others students if they had questions during tutorial sessions for the course Electromagnetism. + at: Delft University of Technology + start: 2018 + end: 2019 diff --git a/yaml/experience.nl.yml b/yaml/experience.nl.yml new file mode 100644 index 0000000..5b4485e --- /dev/null +++ b/yaml/experience.nl.yml @@ -0,0 +1,11 @@ +- name: App Developer + description: Ik heb een interne Android app ontwikkeld voor het kalibreren van temperatuur sensoren. + at: EOCE + start: 2019 + end: 2019 + +- name: Teaching Assistant + description: Ik hielp andere studenten als zij vragen hadden tijdens de werkcolleges voor het vak Elektromagnetisme. + at: TU Delft + start: 2018 + end: 2019