<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Gyula's blog</title><link>https://gyk.ro/</link><description>Recent content on Gyula's blog</description><generator>Hugo</generator><language>en-us</language><copyright>&amp;copy; 2017-2024. All rights reserved.</copyright><lastBuildDate>Fri, 29 Nov 2024 23:37:00 +0200</lastBuildDate><atom:link href="https://gyk.ro/index.xml" rel="self" type="application/rss+xml"/><item><title>Moving servers, to caddy</title><link>https://gyk.ro/2024/11/moving-servers-to-caddy/</link><pubDate>Wed, 27 Nov 2024 22:45:22 +0200</pubDate><guid>https://gyk.ro/2024/11/moving-servers-to-caddy/</guid><description>&lt;p&gt;Bit of a work in progress still&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;m moving hosting providers slowly and want to set up a BlueSky PDS,&#10;they use caddy, and I&amp;rsquo;m interested in the fact that has an api for configuration&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;ll update this as I go&lt;/p&gt;&#10;&lt;p&gt;for now the only thing I can say: check your paths people&lt;/p&gt;&#10;&lt;h3 id="edit-2024-11-28"&gt;EDIT 2024-11-28&lt;/h3&gt;&#10;&lt;p&gt;Got ntfy running on the server, nice and painless&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;m starting to like caddy&lt;/p&gt;&#10;&lt;h3 id="edit-2024-11-29"&gt;EDIT 2024-11-29&lt;/h3&gt;&#10;&lt;p&gt;Portainer and docker are running. Now to move Gitea.&lt;/p&gt;</description></item><item><title>Global scss in SvelteKit</title><link>https://gyk.ro/2022/06/global-scss-in-sveltekit/</link><pubDate>Sat, 11 Jun 2022 10:19:05 +0300</pubDate><guid>https://gyk.ro/2022/06/global-scss-in-sveltekit/</guid><description>&lt;h2 id="tldr"&gt;TL;DR&lt;/h2&gt;&#10;&lt;p&gt;Run: &lt;code&gt;npm i -D nodemon concurrently&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;Add the following npm scripts&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;dev:full&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;concurrently --kill-others \&amp;#34;npm run scss:dev\&amp;#34; \&amp;#34;npm run dev:nodemon\&amp;#34;&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;dev:nodemon&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;nodemon --exec \&amp;#34;npm run dev\&amp;#34;&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;scss&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;sass src/scss/:static/style/&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;scss:dev&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;sass -w src/scss/:static/style/&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Add &lt;code&gt;npm run scss &amp;amp;&amp;amp;&lt;/code&gt; before the &lt;code&gt;build&lt;/code&gt;, &lt;code&gt;package&lt;/code&gt;, &lt;code&gt;preview&lt;/code&gt; and&#10;&lt;code&gt;prepare&lt;/code&gt; scripts&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;build&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;npm run scss &amp;amp;&amp;amp; svelte-kit build&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;package&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;npm run scss &amp;amp;&amp;amp; svelte-kit package&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;preview&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;npm run scss &amp;amp;&amp;amp; svelte-kit preview&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;prepare&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;:&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;npm run scss &amp;amp;&amp;amp; svelte-kit sync&amp;#34;&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="the-setup"&gt;The setup&lt;/h2&gt;&#10;&lt;p&gt;So I started a little project &lt;em&gt;(hopefully I will write about it soon)&lt;/em&gt; and I&#10;tought I would write the frontend in svelte&lt;/p&gt;</description></item><item><title>Automating the Blog... again</title><link>https://gyk.ro/2021/03/automating-the-blog...-again/</link><pubDate>Thu, 04 Mar 2021 21:45:22 +0200</pubDate><guid>https://gyk.ro/2021/03/automating-the-blog...-again/</guid><description>&lt;p&gt;Unsurprisingly, less painful&lt;/p&gt;&#10;&lt;p&gt;Github actions are wonderful, love the integration, and you can find pretty much&#10;everything you need on the marketplace.&lt;/p&gt;&#10;&lt;p&gt;The workflow is almost the same:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Checkout&lt;/li&gt;&#10;&lt;li&gt;Get Hugo&lt;/li&gt;&#10;&lt;li&gt;Build with Hugo&lt;/li&gt;&#10;&lt;li&gt;Rsync&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;you can check out the yaml &lt;a href="https://github.com/gardient/gyulakerezsi.tech/blob/master/.github/workflows/main.yml"&gt;here&lt;/a&gt;&lt;/p&gt;&#10;&lt;h3 id="differences"&gt;Differences&lt;/h3&gt;&#10;&lt;p&gt;I don&amp;rsquo;t need to keep a Hugo executable in the repo, there is an Action that gets&#10;the latest version for me.&lt;/p&gt;&#10;&lt;p&gt;I can keep the ssh key in a repository secret instead of the janky encrypted file&#10;that I used before, there probably was a way with Travis, but nothing quite as simple&lt;/p&gt;</description></item><item><title>Blog</title><link>https://gyk.ro/projects/blog/</link><pubDate>Thu, 04 Mar 2021 12:44:48 +0200</pubDate><guid>https://gyk.ro/projects/blog/</guid><description>&lt;p&gt;Static site generated with &lt;a href="https://gohugo.io/"&gt;Hugo&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Will eventually be automatically deployed with github actions&lt;/p&gt;&#10;&lt;p&gt;see:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://gyk.ro/2017/11/first-post/"&gt;First Post&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://gyk.ro/2017/12/automating-the-blog/"&gt;Automating the Blog&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://gyk.ro/2018/02/making-my-own-theme/"&gt;Making My Own Theme&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://gyk.ro/2021/03/automating-the-blog...-again/"&gt;Automating the Blog&amp;hellip; again&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://gyk.ro/2024/11/moving-servers-to-caddy/"&gt;Moving servers, to caddy&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Dotfiles</title><link>https://gyk.ro/2021/03/dotfiles/</link><pubDate>Thu, 04 Mar 2021 00:01:40 +0200</pubDate><guid>https://gyk.ro/2021/03/dotfiles/</guid><description>&lt;h3 id="it-started-with-a-youtube-video"&gt;It started with a &lt;a href="https://www.youtube.com/watch?v=r_MpUP6aKiQ"&gt;youtube video&lt;/a&gt;&lt;/h3&gt;&#10;&lt;p&gt;And as usual it spiraled out of control (took me a lot of time to update the blog)&lt;/p&gt;&#10;&lt;p&gt;So I made the repo as the video showed, then I realized I like having as close&#10;to a single command as possible&lt;/p&gt;&#10;&lt;p&gt;So I started up on an install script, then I remembered that&#10;&lt;a href="https://github.com/anishathalye/dotbot"&gt;dotbot&lt;/a&gt; was a thing&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;Why reinvent the wheel?&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;h3 id="so-i-didnt-mostly"&gt;So I didn&amp;rsquo;t&amp;hellip; Mostly&lt;/h3&gt;&#10;&lt;p&gt;I wasn&amp;rsquo;t particularly satisfied with the shell module, what I wanted to do with&#10;it was a bit more complex than was elegant with dotbot.&lt;/p&gt;</description></item><item><title>Making My Own Theme</title><link>https://gyk.ro/2018/02/making-my-own-theme/</link><pubDate>Sun, 18 Feb 2018 19:11:24 +0200</pubDate><guid>https://gyk.ro/2018/02/making-my-own-theme/</guid><description>&lt;p&gt;So the theme i used until now was&#10;&lt;a href="https://github.com/yoshiharuyamashita/blackburn"&gt;Blackburn&lt;/a&gt;, it was nice, but&#10;the background was just too white for me.&lt;/p&gt;&#10;&lt;p&gt;Now you might say that i should just override the theme&amp;rsquo;s CSS and be done with&#10;it, but I don&amp;rsquo;t have that kind of aesthetic sense.&lt;/p&gt;&#10;&lt;p&gt;I really should have.&lt;/p&gt;&#10;&lt;p&gt;But here I am, with a new template, that I built, almost from scratch, so let&amp;rsquo;s&#10;see what I learned in the past few days.&lt;/p&gt;</description></item><item><title>My Experience With Tracking by $index</title><link>https://gyk.ro/2017/12/my-experience-with-tracking-by-index/</link><pubDate>Wed, 20 Dec 2017 14:16:48 +0200</pubDate><guid>https://gyk.ro/2017/12/my-experience-with-tracking-by-index/</guid><description>&lt;p&gt;If you found this post while trying to optimize your angular templates, I have a&#10;cautionary tale for you. This might be just me, but this one hurt.&lt;/p&gt;&#10;&lt;p&gt;At work we have an AngularJS application. This application has one particular&#10;list really long, really complex, really grinds the tablets to a halt. How do&#10;you solve that?&lt;/p&gt;&#10;&lt;p&gt;My first tought was, there is too many &lt;code&gt;watch&lt;/code&gt;es in there. One-time bind all the&#10;things. for those of you that dont know one-time binding is done by adding two&#10;colons at the beginnig of the variable name &lt;code&gt;{{::variable}}&lt;/code&gt;. It gets evaluated&#10;once, the first time it has a value, and then angular just forgets about it.&lt;/p&gt;</description></item><item><title>xkcd Calendar Fact Generator</title><link>https://gyk.ro/2017/12/xkcd-calendar-fact-generator/</link><pubDate>Wed, 20 Dec 2017 13:12:09 +0200</pubDate><guid>https://gyk.ro/2017/12/xkcd-calendar-fact-generator/</guid><description>&lt;p&gt;So it started with the new &lt;a href="https://xkcd.com/1930/"&gt;xkcd&lt;/a&gt; today, I tought &amp;ldquo;this&#10;is easy, I&amp;rsquo;ll be done in an hour&amp;rdquo;.&lt;/p&gt;&#10;&lt;p&gt;Then I went down the rabbit-hole that is customizing Hugo.&lt;/p&gt;&#10;&lt;h1 id="but-first-the-generator"&gt;But first the generator&lt;/h1&gt;&#10;&lt;p&gt;You can check it out &lt;a href="https://gyk.ro/random-stuff/xkcd-calendar-facts/"&gt;here&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;The application itself is rather simple, it is carried by two functions, calling&#10;each other.&lt;/p&gt;&#10;&lt;p&gt;The first, taking an array, and making a string out of all it&amp;rsquo;s elements&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-js" data-lang="js"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;function&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;pickOneOfEach&lt;/span&gt; (&lt;span style="color:#a6e22e"&gt;arr&lt;/span&gt;) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;let&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;result&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; (&lt;span style="color:#66d9ef"&gt;let&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;el&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;of&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;arr&lt;/span&gt;) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; (Array.&lt;span style="color:#a6e22e"&gt;isArray&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;el&lt;/span&gt;)) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;result&lt;/span&gt; &lt;span style="color:#f92672"&gt;+=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;pickRandom&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;el&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; } &lt;span style="color:#66d9ef"&gt;else&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;result&lt;/span&gt; &lt;span style="color:#f92672"&gt;+=&lt;/span&gt; String(&lt;span style="color:#a6e22e"&gt;el&lt;/span&gt;) &lt;span style="color:#75715e"&gt;// turn everything to string, because .toString() can be unreliable in what it returns&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;result&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And a second one, getting me a random element from an array&lt;/p&gt;</description></item><item><title>Automating the Blog</title><link>https://gyk.ro/2017/12/automating-the-blog/</link><pubDate>Fri, 08 Dec 2017 21:32:41 +0200</pubDate><guid>https://gyk.ro/2017/12/automating-the-blog/</guid><description>&lt;p&gt;So today after a long while I finally got around to automating the deploy of&#10;the blog.&lt;br&gt;&#10;Tough not the way I initially thought.&lt;/p&gt;&#10;&lt;p&gt;The first idea was to install Hugo on the server and have it periodically pull&#10;and rebuild the &lt;a href="https://github.com/gardient/gyulakerezsi.tech"&gt;repository&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Then I remembered Travis CI.&lt;/p&gt;&#10;&lt;p&gt;I quickly looked it up, and saw that I was not the first to think up the idea&#10;(no big surprise there), so let&amp;rsquo;s see what we can find.&lt;/p&gt;</description></item><item><title>About</title><link>https://gyk.ro/about/</link><pubDate>Wed, 15 Nov 2017 20:11:58 +0200</pubDate><guid>https://gyk.ro/about/</guid><description>&lt;p&gt;A thirty-something year old programmer from Romania&lt;/p&gt;&#10;&lt;p&gt;Will spend a lot of time to automate a simple task rather than doing it by hand&lt;/p&gt;&#10;&lt;p&gt;Will also bash his head at a problem until he either solves it, or gets distracted by food&lt;/p&gt;</description></item><item><title>Contact</title><link>https://gyk.ro/contact/</link><pubDate>Wed, 15 Nov 2017 20:11:52 +0200</pubDate><guid>https://gyk.ro/contact/</guid><description>&lt;p&gt;Email me at &lt;a href="mailto:gyula%5Bat%5Dgyulakerezsi%5Bdot%5Dro"&gt;gyula [at ]gyulakerezsi [dot ]ro&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Twitter, Github, and Gitlab are in the footer, you can find me there too&lt;/p&gt;</description></item><item><title>First Post</title><link>https://gyk.ro/2017/11/first-post/</link><pubDate>Wed, 15 Nov 2017 19:18:24 +0200</pubDate><guid>https://gyk.ro/2017/11/first-post/</guid><description>&lt;p&gt;So for the first post on my blog I will tell you about my experience with &lt;a href="https://gohugo.io"&gt;Hugo&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Setup is simple enough, just follow the instructions on their get started page.&#10;If you are on Windows I recommend installing with &lt;a href="https://chocolatey.org/"&gt;Chocolatey&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;A lot less painful on Windows than Jekyl, as you don&amp;rsquo;t have to mess around with installing ruby&lt;/p&gt;&#10;&lt;p&gt;Last time I tried to set Jekyl up I was messing around for about 3 hours, comparatively this site was about 1 hour, from deciding to set it up to this post&lt;/p&gt;</description></item></channel></rss>