<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.2">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-02-11T12:21:26+11:00</updated><id>/feed.xml</id><title type="html">Alone in the Sea</title><subtitle>A site about coding, software, and related topics</subtitle><entry><title type="html">Remove ‘nul’ file created by Claude in Windows</title><link href="/2026/02/remove-claude-nul-file-in-windows" rel="alternate" type="text/html" title="Remove ‘nul’ file created by Claude in Windows" /><published>2026-02-07T00:00:00+11:00</published><updated>2026-02-07T00:00:00+11:00</updated><id>/2026/02/remove-claude-nul-file-in-windows</id><content type="html" xml:base="/2026/02/remove-claude-nul-file-in-windows"><![CDATA[<p>Open <a href="https://www.geeksforgeeks.org/git/working-on-git-bash/">Git Bash</a> and <code class="language-plaintext highlighter-rouge">cd</code> into the directory where the file is.</p>

<blockquote>
  <p>You will need quotes for the path.</p>
</blockquote>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd "C:/Path/To/Your/Project"
</code></pre></div></div>

<p>Remove nul file.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rm nul
</code></pre></div></div>

<p>Happy days.</p>]]></content><author><name></name></author><category term="journal-other" /><category term="ai" /><category term="claude" /><summary type="html"><![CDATA[Open Git Bash and cd into the directory where the file is.]]></summary></entry><entry><title type="html">Netlify Build Fail</title><link href="/2026/01/adding-gems-fixes-netlify-failed-build" rel="alternate" type="text/html" title="Netlify Build Fail" /><published>2026-01-24T00:00:00+11:00</published><updated>2026-01-24T00:00:00+11:00</updated><id>/2026/01/adding-gems-fixes-netlify-failed-build</id><content type="html" xml:base="/2026/01/adding-gems-fixes-netlify-failed-build"><![CDATA[<p>I drop a fix of a Jekyll site failing on Netlify, in case useful for someone else.</p>

<p>The build was crashing with a Ruby error related to missing standard libraries. It turns out Netlify was using Ruby 3.4.x, and some gems that used to be auto-included are no longer there by default.</p>

<p>The fix was simply adding these two lines to the Gemfile:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gem "csv"
gem "logger"
</code></pre></div></div>

<blockquote>
  <p>To prevent this from happening again it is possible to pin the version via a <code class="language-plaintext highlighter-rouge">.ruby-version</code>.</p>
</blockquote>]]></content><author><name></name></author><category term="journal-other" /><category term="devops" /><category term="netlify" /><category term="ruby" /><summary type="html"><![CDATA[I drop a fix of a Jekyll site failing on Netlify, in case useful for someone else.]]></summary></entry><entry><title type="html">Only Journals</title><link href="/2026/01/only-journals-in-nav" rel="alternate" type="text/html" title="Only Journals" /><published>2026-01-24T00:00:00+11:00</published><updated>2026-01-24T00:00:00+11:00</updated><id>/2026/01/only-journals-in-nav</id><content type="html" xml:base="/2026/01/only-journals-in-nav"><![CDATA[<p>A while ago I realized when I do entries in this blog I prefer to make it as <a href="/2024/01/journals">small entries in a journal</a>.</p>

<p>Now I have moved the “articles” section to two new journals, <a href="/events/">events</a> and <a href="/career/">career</a>.</p>

<p>Some journal entries will be long, some will be short. But I think the idea of the site as a whole flows better like this.</p>

<p>In the case of the <a href="/tutorials/">tutorials</a>, I am leaving them where they are, but removig the link in the navigation bar. I think the core of the site as of today is <a href="/journals/">journals</a>, and it should be the only thing with a link in the nav.</p>]]></content><author><name></name></author><category term="journal-site-updates" /><category term="html" /><category term="web-design" /><summary type="html"><![CDATA[A while ago I realized when I do entries in this blog I prefer to make it as small entries in a journal.]]></summary></entry><entry><title type="html">My first YOW Conference</title><link href="/2025/12/yow" rel="alternate" type="text/html" title="My first YOW Conference" /><published>2025-12-12T00:00:00+11:00</published><updated>2025-12-12T00:00:00+11:00</updated><id>/2025/12/yow</id><content type="html" xml:base="/2025/12/yow"><![CDATA[<p>Today was the last day of the <a href="https://yowcon.com/sydney-2025">YOW</a> conference in Sydney. 
I’ll write some thoughts while the whole experience is still fresh in my mind.</p>

<h2 id="my-first-conference">My first conference</h2>

<p>It was the first time I attended a conference. I had done one-day trainings previously through my company, but I hadn’t attended a conference until this week.</p>

<p>The “spirit” that is in the air at the conference is amazing. Lots of people who are normally coding for hours alone in front of a computer now are together talking, attending presentations, and eating together.</p>

<p>It is really inspiring and refreshing, I would say. It makes all those deadlines from the last few months feel more meaningful somehow (we clearly belong somewhere!).</p>

<h2 id="masterclass">Masterclass</h2>

<p>I attended a one-day masterclass with Kent Beck called <a href="https://yowcon.com/sydney-2025/masterclasses/565/tidy-together-a-software-design-masterclass">Tidy Together: A Software Design Masterclass</a>.</p>

<p>Something interesting I learned was a graphical way of representing Design vs Features, and understanding how, in order to not end up in the “feature saw”, it is convenient to do a small refactoring before implementing each feature to provide a structure for future work.</p>

<p>I won’t try to describe the full day here. I just can say that sharing a day with Kent as a teacher was a real privilege. I learned and felt very inspired to continue learning.</p>

<h2 id="talks">Talks</h2>

<p>I attended many interesting talks. I had to choose specific sessions to attend because there were always three running simultaneously.</p>

<p>I chose many AI-related sessions - I have been working with LLMs in the last few months, so I find the topic interesting. Some notes I took across different sessions:</p>
<ul>
  <li>Using LLMs for writing code is something now embraced by even the most experienced developers. There is a lot of excitement around how the models keep being improved.</li>
  <li>I have the impression that fully vibe coding a project is something that is, at the moment, only working well when coding alone. The process is about designing the high-level way of building the project and advancing “until you can’t steer it in the right direction anymore”. Once you reach that point, it is necessary to restart the process in a new chat and apply the learnings in this new iteration for the architecture to be more correct from the get-go.</li>
  <li>Techniques and libraries are available for developing agents in different languages. There are many different approaches and people who defend their specific way of designing these systems. I have the impression there is a tendency to make “too many calls to the LLM” to solve a problem that could be solved many times in a more deterministic way. It is not only important for the software to give the desired outputs.</li>
  <li>There are ways of doing AI in a green way. <a href="https://www.linkedin.com/in/charleshumble/">Charles Humble</a> gave a beautiful talk about this.</li>
  <li>I have been working with vector databases, but it was refreshing to see a full introduction to the topic to clear doubts.</li>
</ul>

<p>I did attend other talks (Crypto, Naming conventions, C4 Model, Sonic Pi, etc.). But AI, I think, was the predominant topic, and also a topic I needed to dive into on this occasion.</p>

<h2 id="conclusion">Conclusion</h2>

<p>I loved the conference. I will definitely come back in the future.</p>

<p>This was a good opportunity to talk AI with people. Even though I’ve used AI to assist in my coding for a while, and even though I’ve already built RAG projects using vector stores and LLMs, I have never written anything in my blog about it - the space changes so rapidly that I didn’t want to think of writing, maybe? I’m not sure. But here it is, finally, some notes about AI in the blog :).</p>]]></content><author><name></name></author><category term="journal-events" /><category term="ai" /><category term="software" /><summary type="html"><![CDATA[Today was the last day of the YOW conference in Sydney. I’ll write some thoughts while the whole experience is still fresh in my mind.]]></summary></entry><entry><title type="html">More On Revit API</title><link href="/2025/11/more-revit-api-tips" rel="alternate" type="text/html" title="More On Revit API" /><published>2025-11-01T00:00:00+11:00</published><updated>2025-11-01T00:00:00+11:00</updated><id>/2025/11/more-revit-api-tips</id><content type="html" xml:base="/2025/11/more-revit-api-tips"><![CDATA[<p>This post is a small collection of ideas I’ve been wanting to write down for a while. It is basically a bit of a continuation of <a href="/2024/01/revit-api-intro">this previous post</a> - more Revit API tips for anyone jumping into it.</p>

<p>Truth to be told, at the time I am writing this post, I haven’t been coding Revit API Addins for months (I’ve been doing Desktop apps lately), so if something I write doesn’t make sense, please leave a comment and I will review it. Here it goes:</p>

<h2 id="hot-reload-during-development---rapid-iteration">Hot Reload During Development - Rapid Iteration</h2>

<p>We all want to modify the code a little bit and immediately jump to the Revit UI and see if it does what we want. But the default setup requires you to close Revit, build the new DLL and open Revit again. It takes time.</p>

<p>For a solution, I would recommend anyone to take a look at <a href="https://youtu.be/KHMwd4U_Lrs?list=PLFCkCJ3EkCJ6irc8-QwipB3TTsvlz2_xa&amp;t=417">Joshua Lumley’s example</a> to achieve rapid iteration (hot reload). I think what is best from his example is that it is pure code (no magic happening in the background), so it opens the door to more learning than when using a pre-built tool for hot reload (e.g. <a href="https://github.com/chuongmep/RevitAddInManager">RevitAddInManager</a>).</p>

<blockquote>
  <p><em>From what I remember, basically works like this: a single DLL will be “locked” (it might be the one you point to in the addin file). That one you can’t really modify. But that single DLL, using <a href="https://stackoverflow.com/questions/2202381/reflection-how-to-invoke-method-with-parameters">reflection</a> (the “invoke” mentioned by Joshua), can call other DLLs that can be hot-reloaded. Then you end up with at least two projects in your solution: one has the code that will be locked, and the other one/ones will contain code that is called using reflection and hot-reloaded at will.</em></p>
</blockquote>

<h2 id="how-to-use-revit-lookup">How to use Revit Lookup</h2>

<p>Revit Lookup is clearly the must-have tool for developing Revit Addins, but when starting to code for the first time, it doesn’t seem very intuitive. I am going to write a few bullet points below, hoping it will be useful for someone:</p>
<ul>
  <li>The only command I’ve always used is the <em>“Snoop Selection”</em>. Other parts of the tool might be very useful, but if you only learn to use <em>“Snoop Selection”</em>, it is already a lot of help.</li>
  <li>In <a href="/2024/01/revit-api-change-parameters">this previous post</a> I explain how I use <em>“Snoop Selection”</em> to learn how to set a parameter of a Revit element - Have a look at it, hopefully it makes sense.</li>
  <li>When you open an element with “<em>Snoop Selection</em>”, what you are doing is discovering whatever that element resembles in the Revit API. You are having a look at an object of a Revit API class; therefore, you should be opening the <a href="https://apidocs.co/">Revit API docs</a> page and taking a look at the class itself as well.</li>
  <li>When you look at the element in Revit Lookup and compare what you see with the class in the API docs, you will see that some information is missing. That’s normal - you will only see in Revit Lookup what can be shown without providing further arguments (see explanation <a href="https://github.com/lookup-foundation/RevitLookup/issues/35#issuecomment-321482729">here</a>).</li>
  <li>Sometimes the UI element you click and the class that pops up will not make sense straight away, and that’s normal. I think it is normal to “imagine” how the classes are in the Revit API from only looking at the element in the Revit UI - then, when we open the corresponding class and dig into the docs, sometimes we learn things are very different from what we imagined.</li>
  <li>At the end of the day, when using Revit Lookup, you are, in a way, diving into the Revit API docs. For understanding the Revit API docs, I think “Object Oriented Programming” is something useful to study - Google it, watch a video, or maybe have a look at <a href="https://www.google.com.ar/books/edition/The_Object_Oriented_Thought_Process/E8OPDwAAQBAJ?hl=en&amp;gbpv=0">this book</a>.</li>
</ul>

<h2 id="go-with-windows-forms">Go with Windows Forms</h2>

<p>I have worked with Revit Addins using WPF. As per <a href="https://stackoverflow.com/questions/42840938/wpf-ui-not-refresh-revit-pluggin#answer-42852082">this comment</a>, I would recommend anyone to use Windows Forms instead.</p>

<h2 id="understanding-transform">Understanding Transform</h2>

<p>I would look at <a href="https://youtu.be/j-Fv086zLnk?t=1493">this video</a> (Joshua again) if I need to understand <a href="https://apidocs.co/apps/revit/2025.3/58dd01c8-b3fc-7142-e4f3-c524079a282d.htm">Transform</a> (it is the only animation I’ve found online showing it work).</p>

<h2 id="conclusion">Conclusion</h2>

<p>That’s it for today. I might put together more relevant notes in the future and create another post. If this was useful for you, and you would like something specific to be added in the next post, please don’t hesitate to message or leave a comment.</p>]]></content><author><name></name></author><category term="journal-revit-api" /><category term="c#" /><category term="revit-api" /><category term="revit-lookup" /><category term="oop" /><summary type="html"><![CDATA[This post is a small collection of ideas I’ve been wanting to write down for a while. It is basically a bit of a continuation of this previous post - more Revit API tips for anyone jumping into it.]]></summary></entry><entry><title type="html">The Good Parts Of Revit API?</title><link href="/2025/04/revit-api-good-parts" rel="alternate" type="text/html" title="The Good Parts Of Revit API?" /><published>2025-04-20T00:00:00+10:00</published><updated>2025-04-20T00:00:00+10:00</updated><id>/2025/04/revit-api-good-parts</id><content type="html" xml:base="/2025/04/revit-api-good-parts"><![CDATA[<p>A few weeks ago I found an <a href="https://forums.autodesk.com/t5/revit-api-forum/math-behinde-isalmostequalto/m-p/9697613/highlight/true#M49075">Autodesk forum post</a> where people commented on how <code class="language-plaintext highlighter-rouge">IsAlmostEqualTo</code> method doesn’t work as they expect in some scenarios (I arrived to that post facing unexpected results comparing two <code class="language-plaintext highlighter-rouge">XYZ</code> objects with that method - I ended up creating an extension method for the class that can be used instead of <code class="language-plaintext highlighter-rouge">IsAlmostEqualTo</code>).</p>

<p>That forum post reminded me of a Douglas Crockford presentation I watched a while ago (maybe <a href="https://youtu.be/DogGMNBZZvg?t=778">this one</a> - I didn’t save the link to the exact video) on the “good parts” of JavaScript (there is also a <a href="https://books.google.com.au/books/about/JavaScript_The_Good_Parts.html?id=PXa2bby0oQ0C&amp;redir_esc=y">book</a>). The main idea that stuck in my head after the presentation is that not all the features in a language are necessarily there to be used - some are there because they can’t be taken out (it’s too late). So we need to learn to use the good parts only.</p>

<p>Maybe there is a list of methods of the Revit API that is best not to use. If someone has a link to an article listing them please let me know.</p>]]></content><author><name></name></author><category term="journal-revit-api" /><category term="c#" /><category term="revit-api" /><summary type="html"><![CDATA[A few weeks ago I found an Autodesk forum post where people commented on how IsAlmostEqualTo method doesn’t work as they expect in some scenarios (I arrived to that post facing unexpected results comparing two XYZ objects with that method - I ended up creating an extension method for the class that can be used instead of IsAlmostEqualTo).]]></summary></entry><entry><title type="html">Fixing an Inno Setup Installer Script</title><link href="/2025/04/inno-setup" rel="alternate" type="text/html" title="Fixing an Inno Setup Installer Script" /><published>2025-04-08T00:00:00+10:00</published><updated>2025-04-08T00:00:00+10:00</updated><id>/2025/04/inno-setup</id><content type="html" xml:base="/2025/04/inno-setup"><![CDATA[<p>A few weeks ago I had to fix an <a href="https://jrsoftware.org/isinfo.php">Inno Setup</a> script.</p>

<p>It was my first time writing code in <a href="https://stackoverflow.com/questions/13933485/which-language-is-supported-in-the-code-section-of-inno-setup#answer-13933525">Pascal Script</a>, and my first time working with Inno Setup. It was a fun experience and I learned a few new things.</p>

<p>Today I wanted to write down some of my learnings to have them as a reference for the future, and to share them in case anyone trying to update an installer script for the first time could find them useful.</p>

<h2 id="documentation">Documentation</h2>

<p>The Inno Setup documentation is available <a href="https://jrsoftware.org/ishelp/">online</a> and also in the Inno Setup app by going to <em>Help &gt; Inno Setup Documentation</em> (or pressing F1). For some reason, it was easier for me to find things in the Desktop app.</p>

<p>It is worth mentioning that sometimes the docs refer to files in the installation folder 
(the “Examples” subfolder or the ““ISPPBuiltins.iss” file), so you have to find your installation folder 
(mine was at <code class="language-plaintext highlighter-rouge">%localappdata%\Programs\Inno Setup 6</code>) or use as a reference the online 
repository (I leave links to the <a href="https://github.com/jrsoftware/issrc/tree/54e3e82fac8eb53d12191b0bb94e0cd545497d78/Examples">“Examples” dir</a> 
and <a href="https://github.com/jrsoftware/issrc/blob/54e3e82fac8eb53d12191b0bb94e0cd545497d78/Files/ISPPBuiltins.iss">“ISPPBuiltins.iss” file</a>).</p>

<blockquote>
  <p>Comment: if you want to save the link to a specific section of the online documentation, <strong>right-click the link on the web page and choose “Copy Link”</strong> - otherwise when using left clicks, the URL remains the same.</p>
</blockquote>

<h2 id="ispp-and-pascal-script">ISPP and Pascal Script</h2>

<p>When working with the <code class="language-plaintext highlighter-rouge">.iss</code> I had to work with <a href="https://jrsoftware.org/ishelp/index.php?topic=scriptintro">Pascal Script code</a> and <a href="https://jrsoftware.org/ishelp/index.php?topic=isppoverview">Preprocessor code</a>.</p>

<p>For me, Pascal Script is easier to write, but the Preprocessor code has the advantage of allowing you to do compile-time tasks. The truth is that the online community around Inno Setup is very strong, and most of the common problems have already been solved and their solutions are available online.</p>

<h2 id="global-settings">Global Settings</h2>

<p>The <a href="https://jrsoftware.org/ishelp/topic_setupsection.htm">[Setup] section</a> contains global settings - here is where I used preprocessor code the most.</p>

<p>I think that maybe this is one of the places where the power of Inno Setup shows. There are a lot of different directives and by setting them a lot can be achieved without much code.</p>

<h2 id="constants">Constants</h2>

<p>It is important to understand how to access <a href="https://jrsoftware.org/ishelp/index.php?topic=consts">these constants</a> using <a href="https://jrsoftware.org/ishelp/topic_isxfunc_expandconstant.htm">ExpandConstant</a>.</p>

<p>The constant that called my attention the most was <code class="language-plaintext highlighter-rouge">{tmp}</code> because it is <strong>not</strong> the value of the user’s TEMP environment variable, so it can be confusing.</p>

<h2 id="command-line-options">Command line options</h2>
<p>The command line parameters are listed <a href="https://jrsoftware.org/ishelp/topic_setupcmdline.htm">here</a>.</p>

<p>If using <code class="language-plaintext highlighter-rouge">/SUPPRESSMSGBOXES</code> parameter, you need to use the <a href="https://jrsoftware.org/ishelp/topic_isxfunc_suppressiblemsgbox.htm">suppressible msg boxes</a>.</p>

<p>When using <code class="language-plaintext highlighter-rouge">/LOG</code> parameter you get more information than the entries you log manually with the <a href="https://jrsoftware.org/ishelp/index.php?topic=isxfunc_log">Log</a> function, which is cool.</p>

<h2 id="notes-on-pascal-script">Notes on Pascal Script</h2>

<p>I’ll be brief because I don’t want to replicate the docs here.</p>

<p>I got stuck a few times because of using <code class="language-plaintext highlighter-rouge">=</code> instead of <code class="language-plaintext highlighter-rouge">:=</code> to assign a variable. This got specially confusing when jumping between setting the global settings at [Setup] section and after working with   Pascal Script in other sections.</p>

<p>I think I would most of the time add a <code class="language-plaintext highlighter-rouge">BoolToStr</code> function as per <a href="https://stackoverflow.com/questions/35040656/convert-boolean-to-string-with-inno-setup">here</a> to work more comfortably.</p>

<h2 id="conclusion">Conclusion</h2>

<p>Inno Setup is an amazing tool. At first glance, I didn’t feel very excited about coding in Pascal Script, but when I realized how good the tool is and how strong the online community around it is, I realized I’m very lucky I got to work with it. I would recommend it to anyone thinking of creating a Windows installer.</p>]]></content><author><name></name></author><category term="journal-other" /><category term="pascal-script" /><category term="inno-setup" /><category term="windows" /><summary type="html"><![CDATA[A few weeks ago I had to fix an Inno Setup script.]]></summary></entry><entry><title type="html">Edge Array to Curveloop</title><link href="/2025/03/edge-array-to-curveloop" rel="alternate" type="text/html" title="Edge Array to Curveloop" /><published>2025-03-30T00:00:00+11:00</published><updated>2025-03-30T00:00:00+11:00</updated><id>/2025/03/edge-array-to-curveloop</id><content type="html" xml:base="/2025/03/edge-array-to-curveloop"><![CDATA[<p>If from a <a href="https://apidocs.co/apps/revit/2024/e32b3b1f-66fc-57cb-6e1c-aa81d1bf3e63.htm">Face</a> object you get its <a href="https://apidocs.co/apps/revit/2024/2ccb511d-b5df-8d17-bd9e-3c9aff8cf234.htm">EdgeLoops</a>, and from there you get an <a href="https://apidocs.co/apps/revit/2024/7069d0a1-fc52-a347-e0d8-6de1f40797d3.htm">EdgeArray</a>, that edge array is not that easy to make into a <a href="https://apidocs.co/apps/revit/2024/84824924-cb89-9e20-de6e-3461f429dfd6.htm">CurveLoop</a>.</p>

<p>After testing with a few solids I arrived to the conclusion that the Edges in the EdgeArray are in the correct order (two consecutive Edges share a point) but they sometimes don’t have the same orientation.</p>

<p>In a closed CurveLoop, every Curve starts where the previous one ended. Instead in an EdgeArray, every Edge shares a point with the previous Edge, though you don’t know for sure which point. Because of that, when making the EdgeArray into a CurveLoop it is necessary to check the orientation of each Edge and correct it if necessary.</p>

<p>Last comments:</p>
<ul>
  <li>I used the <a href="https://apidocs.co/apps/revit/2024/4d780a44-c713-036f-840f-605527bbb2ce.htm">AsCurve</a> method from the Edge objects to get the curves, and there is where I identified the different orientations.</li>
  <li>There is a <a href="https://apidocs.co/apps/revit/2024/4410caa7-3f65-1aed-763c-4f23510d6c17.htm">GetEdgesAsCurveLoops</a> method available in the Face class, which might be useful to avoid coding the EdgeArray to CurveLoop, but I haven’t tried it out.</li>
</ul>]]></content><author><name></name></author><category term="journal-revit-api" /><category term="c#" /><category term="revit-api" /><summary type="html"><![CDATA[If from a Face object you get its EdgeLoops, and from there you get an EdgeArray, that edge array is not that easy to make into a CurveLoop.]]></summary></entry><entry><title type="html">Bash Scripts To Start Work</title><link href="/2025/02/bash" rel="alternate" type="text/html" title="Bash Scripts To Start Work" /><published>2025-02-09T00:00:00+11:00</published><updated>2025-02-09T00:00:00+11:00</updated><id>/2025/02/bash</id><content type="html" xml:base="/2025/02/bash"><![CDATA[<p>Today I automated the “setup to start working” for one of my projects. It is a site that uses an API, and every time I wanted to start working on it I had to open the two projects independently, open the browser, and run the two projects. I created a bash script that manages opening everything, and another one to close it all. This lets me fully focus on the code and start quickly with a simple <a href="/2024/02/double-click-execute-bash-linux">double click</a>.</p>

<p>Script for opening everything:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>

<span class="nv">API_DIR</span><span class="o">=</span><span class="s2">"/path/to/api/project/dir"</span>
<span class="nv">SITE_DIR</span><span class="o">=</span><span class="s2">"/path/to/site/project/dir"</span>

<span class="c"># opening the API in vscode and running the the API in a new terminal </span>
code <span class="s2">"</span><span class="nv">$API_DIR</span><span class="s2">"</span>
gnome-terminal <span class="nt">--working-directory</span><span class="o">=</span><span class="s2">"</span><span class="nv">$API_DIR</span><span class="s2">"</span> <span class="nt">--</span> bash <span class="nt">-c</span> <span class="s2">"
    source '</span><span class="nv">$API_DIR</span><span class="s2">/.venv/bin/activate';
    python '</span><span class="nv">$API_DIR</span><span class="s2">/main.py';
    exec bash
"</span>

<span class="c"># opening the Site in vscode,running the Site in a new terminal, and opening it in firefox</span>
code <span class="s2">"</span><span class="nv">$SITE_DIR</span><span class="s2">"</span>
gnome-terminal <span class="nt">--working-directory</span><span class="o">=</span><span class="s2">"</span><span class="nv">$SITE_DIR</span><span class="s2">"</span> <span class="nt">--</span> bash <span class="nt">-c</span> <span class="s2">"
    docker start containername -i;
    exec bash
"</span>
<span class="nb">sleep </span>5 <span class="c"># waiting for 5 seconds untill the site is running</span>
firefox http://0.0.0.0:8080/

</code></pre></div></div>

<p>Script for closing it all:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>

<span class="c"># Close all VS Code instances</span>
pkill <span class="nt">-f</span> <span class="s2">"code"</span>

<span class="c"># Close all terminal windows</span>
pkill <span class="nt">-f</span> <span class="s2">"gnome-terminal"</span>

</code></pre></div></div>

<p>As many other scripts, I saved these two in my <a href="https://github.com/lmponcio/aits-code_snippets">code snippets repository</a>.</p>]]></content><author><name></name></author><category term="journal-other" /><category term="bash" /><summary type="html"><![CDATA[Today I automated the “setup to start working” for one of my projects. It is a site that uses an API, and every time I wanted to start working on it I had to open the two projects independently, open the browser, and run the two projects. I created a bash script that manages opening everything, and another one to close it all. This lets me fully focus on the code and start quickly with a simple double click.]]></summary></entry><entry><title type="html">Adding a Hotkeys Page</title><link href="/2025/02/hotkeys-page" rel="alternate" type="text/html" title="Adding a Hotkeys Page" /><published>2025-02-06T00:00:00+11:00</published><updated>2025-02-06T00:00:00+11:00</updated><id>/2025/02/hotkeys-page</id><content type="html" xml:base="/2025/02/hotkeys-page"><![CDATA[<p>A while ago <a href="/2024/01/navigation-links-keyboard-shortcuts">I added hotkeys</a> to the site. Today I added a few more and I realized I would like to have a page for them, so <a href="/hotkeys">here it is</a>.</p>

<p>Implementing some of the hotkeys required preventing the default browser behaviour (<code class="language-plaintext highlighter-rouge">event.preventDefault()</code>). As of this point I use together the site hotkeys plus a <a href="https://lydell.github.io/LinkHints/">browser extension</a> to navigate and play around on the site without the mouse.</p>

<h3 id="jekyll-minima-comments">Jekyll Minima Comments</h3>

<p>Some hotkeys work on every page (for scrolling and navigating to the search page). Those I added in a <code class="language-plaintext highlighter-rouge">&lt;script&gt;</code> tag in <code class="language-plaintext highlighter-rouge">_layouts/default.html</code>. Others work only in a post (for navigating to the next or previous post). Those I added in a <code class="language-plaintext highlighter-rouge">&lt;script&gt;</code> tag in <code class="language-plaintext highlighter-rouge">_layouts/post.html</code>.</p>]]></content><author><name></name></author><category term="journal-site-updates" /><category term="html" /><category term="jekyll" /><category term="jekyll-minima" /><category term="web-design" /><category term="hotkeys" /><summary type="html"><![CDATA[A while ago I added hotkeys to the site. Today I added a few more and I realized I would like to have a page for them, so here it is.]]></summary></entry></feed>