<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Barney</title>
    <description>The latest articles on DEV Community by Barney (@lagsurfer).</description>
    <link>https://dev.to/lagsurfer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F70302%2Faf83b587-9181-4881-bc1e-1f6936422b07.jpg</url>
      <title>DEV Community: Barney</title>
      <link>https://dev.to/lagsurfer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lagsurfer"/>
    <language>en</language>
    <item>
      <title>How do you build AWS AMIs?</title>
      <dc:creator>Barney</dc:creator>
      <pubDate>Thu, 22 Dec 2022 09:49:25 +0000</pubDate>
      <link>https://dev.to/lagsurfer/how-do-you-build-aws-amis-5bjb</link>
      <guid>https://dev.to/lagsurfer/how-do-you-build-aws-amis-5bjb</guid>
      <description>&lt;p&gt;How do you build an AMI locally manually? I don't want to create AMI from existing EC2 but that's the only thing that I found online. &lt;br&gt;
I have my jar and I want to create an AMI from my jar.&lt;/p&gt;

</description>
      <category>designpatterns</category>
      <category>fullstack</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Redis as primary database?</title>
      <dc:creator>Barney</dc:creator>
      <pubDate>Fri, 23 Apr 2021 08:04:05 +0000</pubDate>
      <link>https://dev.to/lagsurfer/redis-as-primary-database-2gkk</link>
      <guid>https://dev.to/lagsurfer/redis-as-primary-database-2gkk</guid>
      <description>&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://redislabs.com/blog/goodbye-cache-redis-as-a-primary-database/"&gt;https://redislabs.com/blog/goodbye-cache-redis-as-a-primary-database/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This says now with AOF it can be used as a primary database. Any thoughts on this? Or experience? For simple apps this could be pretty cool. &lt;/p&gt;

</description>
      <category>redis</category>
      <category>database</category>
      <category>discuss</category>
      <category>help</category>
    </item>
    <item>
      <title>Anyone know what's up with these "fake" github accounts forking/starring random repositories?</title>
      <dc:creator>Barney</dc:creator>
      <pubDate>Fri, 09 Apr 2021 17:44:43 +0000</pubDate>
      <link>https://dev.to/lagsurfer/anyone-know-what-s-up-with-these-fake-github-accounts-forking-starring-random-repositories-520k</link>
      <guid>https://dev.to/lagsurfer/anyone-know-what-s-up-with-these-fake-github-accounts-forking-starring-random-repositories-520k</guid>
      <description>&lt;p&gt;Hey!&lt;/p&gt;

&lt;p&gt;I've been doing many POC projects and sharing them on Github. Most of the time these are just tutorials I've completed. Nothing interesting or valuable really. And time to time I notice that someone starred my repo. I checked these account's activity and it seemed like they are just starring and forking random (random to me) repositories. Does anyone have an idea why? &lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>repository</category>
      <category>account</category>
    </item>
    <item>
      <title>How many threads should I create? (worker_threads) Nodejs</title>
      <dc:creator>Barney</dc:creator>
      <pubDate>Mon, 30 Nov 2020 14:51:13 +0000</pubDate>
      <link>https://dev.to/lagsurfer/how-many-threads-should-i-create-workerthreads-5022</link>
      <guid>https://dev.to/lagsurfer/how-many-threads-should-i-create-workerthreads-5022</guid>
      <description>&lt;p&gt;I recently started looking into nodejs's thead_workers module. It seems really interesting however there is one thing that is not self-evident. The official documentation says that I should create a threadpool. But what should be the size of my threadpool? Should it be equal to my phyisical CPU count or cpu's thread count? For example I have a i5 with 4 cores and 8 threads. On my machine should I create a threadpool of 4 or 8? Less or more? &lt;/p&gt;

</description>
      <category>node</category>
      <category>help</category>
      <category>discuss</category>
      <category>javascript</category>
    </item>
    <item>
      <title>can't use .filter() after .forEach()</title>
      <dc:creator>Barney</dc:creator>
      <pubDate>Tue, 11 Aug 2020 11:46:03 +0000</pubDate>
      <link>https://dev.to/lagsurfer/can-t-use-filter-after-foreach-2lpn</link>
      <guid>https://dev.to/lagsurfer/can-t-use-filter-after-foreach-2lpn</guid>
      <description>&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;So I came across this problem. &lt;/p&gt;

&lt;p&gt;I have an array of N elements. I'd like to run every element against a function. &lt;/p&gt;

&lt;p&gt;so I would go:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myArray.forEach(item=&amp;gt;process(item)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now I want to filter some of them and call another function on the rest of them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   .forEach(item=&amp;gt;process(item)
   .filter( somelogic )
   .forEach( item=&amp;gt;postProcessSome(item) );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But that's not valid code. forEach returns undefined so I can't call filter. I can use map instead of forEach but that way I can't use one liners. &lt;/p&gt;

&lt;p&gt;What's an elegant way to do this? For example in Java I could use .peek that acts like a foreach but returns the value. &lt;/p&gt;

&lt;p&gt;Thanks for help.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>help</category>
      <category>discuss</category>
    </item>
    <item>
      <title>How to run a long lasting query without interruption?</title>
      <dc:creator>Barney</dc:creator>
      <pubDate>Fri, 26 Jun 2020 15:36:10 +0000</pubDate>
      <link>https://dev.to/lagsurfer/how-to-run-a-long-lasting-query-without-interrupting-58i4</link>
      <guid>https://dev.to/lagsurfer/how-to-run-a-long-lasting-query-without-interrupting-58i4</guid>
      <description>&lt;p&gt;I have a query like this:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;insert into table1 (field1, field2) select (field1, field2) from  table2&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;It's running on a huge table with millions of rows. It might take several hours or days but it wouldn't be a problem. The problem is right now  that my client (dbeaver) constantly dropping the connection and my query fails. How would you handle this problem? &lt;br&gt;
Thanks    &lt;/p&gt;

</description>
      <category>sql</category>
      <category>postgres</category>
      <category>help</category>
      <category>database</category>
    </item>
    <item>
      <title>Expose local server over SSL? (Messenger bot)</title>
      <dc:creator>Barney</dc:creator>
      <pubDate>Sat, 20 Jun 2020 16:34:22 +0000</pubDate>
      <link>https://dev.to/lagsurfer/expose-local-server-over-ssl-messenger-bot-17l</link>
      <guid>https://dev.to/lagsurfer/expose-local-server-over-ssl-messenger-bot-17l</guid>
      <description>&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;In the past I've been working on a chatbot and now I want to continue development but I can't seem to find a solution to expose my local server over HTTPS. Facebook messenger API only works over HTTPS.&lt;/p&gt;

&lt;p&gt;I've read some articles about ngrok but it recently changed plans so the free plan no longer works (no static address which makes development possible but uneasy). &lt;/p&gt;

&lt;p&gt;Also I've found another service called serveo.net whichs looked promising but it seems like HTTPS is not supported.&lt;/p&gt;

&lt;p&gt;Any suggestion? &lt;/p&gt;

&lt;p&gt;Thanks! &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>networking</category>
      <category>help</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
