<?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>Forem: Vaclav Mlejnsky</title>
    <description>The latest articles on Forem by Vaclav Mlejnsky (@mlejva).</description>
    <link>https://forem.com/mlejva</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%2F194342%2Fe4a4676e-a04b-4f17-a776-b34ffa98db7c.jpeg</url>
      <title>Forem: Vaclav Mlejnsky</title>
      <link>https://forem.com/mlejva</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mlejva"/>
    <language>en</language>
    <item>
      <title>Nicely asking our users to update the app through an XSS attack</title>
      <dc:creator>Vaclav Mlejnsky</dc:creator>
      <pubDate>Mon, 22 Mar 2021 16:47:31 +0000</pubDate>
      <link>https://forem.com/mlejva/nicely-asking-our-users-to-update-the-app-through-an-xss-attack-5d3j</link>
      <guid>https://forem.com/mlejva/nicely-asking-our-users-to-update-the-app-through-an-xss-attack-5d3j</guid>
      <description>&lt;p&gt;&lt;a href="https://usedevbook.com"&gt;Devbook&lt;/a&gt; is a desktop app that allows developers to search Stack Overflow, official documentation, and code on GitHub. It's the first step in building a search engine for developers.&lt;/p&gt;

&lt;p&gt;We &lt;a href="https://news.ycombinator.com/item?id=25394567"&gt;shared&lt;/a&gt; a crude first version of Devbook on Hacker News in December. HN folks seemed to like it. Devbook was on the front page and eventually got to the #5 spot. We were excited! People might actually like what we built!&lt;/p&gt;

&lt;p&gt;Feedback and suggestions started coming in. It was time to work on an update. With this momentum, working on the next version was easy. We shipped a new update in the next few days and were ready to hear what people think.&lt;/p&gt;

&lt;p&gt;Here came the horrible realization though - we forgot to ship the auto-update functionality in the first version. How will people already using Devbook update to the new version? This isn't a website or a mobile app. Devbook is a desktop app distributed outside of any app store. People don't just receive notifications about a new version.&lt;/p&gt;

&lt;p&gt;About 500 users from HN were stuck on the first version, unable to update and we had no way to reach out to them. In the grand scheme of things, 500 users are not that many. For us though, it was crucial to get them to update to the new version and learn what they think. Those 500 users were everything. We had to come up with some way to inform them about a new version.&lt;/p&gt;

&lt;p&gt;Time to get creative. We started thinking. The app is communicating with our server every time a user searches. So there might be a way to get our message across. Maybe every time when a user searches in Devbook we could change the content of the first result so it tells the user to update?&lt;/p&gt;

&lt;p&gt;Then it hit us. What we were actually sending as a search response from our server was the actual Stack Overflow HTML. In Devbook, we just (dangerously and with great ignorance) injected the HTML into the app's frontend. That's great (if you ignore the security implications of course)! It means we can change the HTML to whatever we want!&lt;/p&gt;

&lt;p&gt;Yeah, but how do we know which users should actually receive the custom HTML? We had people using two versions of the app - one without the auto-updater and one with the auto-updater. Well, here comes the ugliness of all this. As I said above, we were injecting the HTML code directly into the app's frontend. This means the HTML code isn't sanitized. With this, we can theoretically run any code we want. We could use Electron's API to find out the version of the app and show the update prompt based on that.&lt;/p&gt;

&lt;p&gt;That's exactly what we ended up doing. We injected our custom script to the &lt;code&gt;onerror&lt;/code&gt; event listener on the &lt;code&gt;&amp;lt;img/&amp;gt;&lt;/code&gt; tag&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"display:none"&lt;/span&gt; &lt;span class="na"&gt;onerror=&lt;/span&gt;&lt;span class="s"&gt;"update_code"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's the actual code prompting user to update&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Cleanup the old download reminder&lt;/span&gt;
&lt;span class="nx"&gt;clearTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;devbookUpdateHandle&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isDevbookNewVersionCheckDisabled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;remote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;electron&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;remote&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;appVersion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;remote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getVersion&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;appVersion&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0.0.1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;askForNewVersionDownload&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isDevbookNewUpdateSilenced&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;shouldDownload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;confirm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;New Devbook version is available &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;n&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;n Click OK to download. &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;n&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;n You must install the new version manually!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;shouldDownload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;remote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shell&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openExternal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;new_version_url&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;clearTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;devbookNewUpdateHandle&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;updateHandle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nx"&gt;askForNewVersionDownload&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;devbookNewUpdateHandle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;updateHandle&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isDevbookNewUpdateSilenced&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;askForNewVersionDownload&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;4000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isDevbookNewVersionCheckDisabled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the actual model that a user sees&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ELuCLjmW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43prqemm44la7rziw9fq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ELuCLjmW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43prqemm44la7rziw9fq.png" alt="Screen Shot 2021-03-22 at 3.35.52 PM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Eventually, about 150 users updated through this hack to a &lt;a href="https://usedevbook.com"&gt;Devbook&lt;/a&gt; version that has an auto-updater.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>html</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Search Stack Overflow, docs, and code on GitHub from a single app</title>
      <dc:creator>Vaclav Mlejnsky</dc:creator>
      <pubDate>Sat, 13 Mar 2021 19:38:13 +0000</pubDate>
      <link>https://forem.com/mlejva/search-stack-overflow-docs-and-code-on-github-from-a-single-app-4c10</link>
      <guid>https://forem.com/mlejva/search-stack-overflow-docs-and-code-on-github-from-a-single-app-4c10</guid>
      <description>&lt;p&gt;Hey all!&lt;/p&gt;

&lt;p&gt;My friend and I are both developers and working on the app called &lt;a href="https://usedevbook.com"&gt;Devbook&lt;/a&gt;. I thought this community might find it especially useful. It's basically a search engine made just for developers.&lt;/p&gt;

&lt;p&gt;It's a desktop app available for Windows, Linux, macOS. It works similar to Spotlight on macOS. You hit a global shortcut and Devbook appears as an overlay on top of any app you might be using. Then you just start typing and we search Stack Overflow, code on GitHub and docs. No ads, content marketing, personalization, slow websites, etc. Plus it's all controllable using just a keyboard. This way you almost don't need to leave your coding editor.&lt;/p&gt;

&lt;p&gt;The goal was to keep you as a programmer productive as much as possible and minimize the annoying context switching.&lt;/p&gt;

&lt;p&gt;We made this based on our own needs. We realized how much time we spent on Google searching for stuff when coding. Looking for information should be a better experience than that. A place where developers first-class citizens.&lt;/p&gt;

&lt;p&gt;Here's a short video of me using Devbook&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/569pYL7i1J0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Would love to learn what you folks think. Give it a try and let me know!&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>programming</category>
      <category>showdev</category>
    </item>
    <item>
      <title>What productivity tools are you using?</title>
      <dc:creator>Vaclav Mlejnsky</dc:creator>
      <pubDate>Mon, 18 Jan 2021 17:55:44 +0000</pubDate>
      <link>https://forem.com/mlejva/what-productivity-tools-are-you-using-2bkh</link>
      <guid>https://forem.com/mlejva/what-productivity-tools-are-you-using-2bkh</guid>
      <description>&lt;p&gt;Hey folks! &lt;/p&gt;

&lt;p&gt;I think most of the developers like to explore different tooling to make them more productive. Tools like Vim or Emacs seems like proof of this (not commenting on their learning curve though).&lt;/p&gt;

&lt;p&gt;One of the things developers spend most of their is search. We read different studies concluding that devs spend about 15% of their time just typing queries into Google. My co-founder and I care about developers' productivity a lot and we think there should be a better solution.&lt;br&gt;
We started building &lt;a href="https://usedevbook.com"&gt;Devbook&lt;/a&gt;. Devbook is a search engine for developers. We are starting with a crude initial version that allows you to search in docs, Stack Overflow, and public GitHub code using a single input (more resources coming soon!). It's a desktop app that works similar to spotlight we the focus on being able to control using just a keyboard and not getting in your way.&lt;br&gt;
We have all kinds of developers using Devbook. There beginners, students, or skilled senior devs from companies like Amazon. &lt;/p&gt;

&lt;p&gt;You can download Devbook &lt;a href="https://usedevbook.com"&gt;here&lt;/a&gt;. For now, it's completely free.&lt;/p&gt;

&lt;p&gt;Would love to know what do you think about Devbook!&lt;/p&gt;

&lt;p&gt;Also, I'd be interested to know what tools and services are you using to make you more productive? Share your stack!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>programming</category>
      <category>productivity</category>
      <category>devtools</category>
    </item>
    <item>
      <title>I am building an app that makes your terminal collaborative and team-friendly. Would you use it?</title>
      <dc:creator>Vaclav Mlejnsky</dc:creator>
      <pubDate>Tue, 18 Aug 2020 13:52:44 +0000</pubDate>
      <link>https://forem.com/mlejva/i-am-building-an-app-that-makes-your-terminal-collaborative-and-team-friendly-would-you-use-it-4lol</link>
      <guid>https://forem.com/mlejva/i-am-building-an-app-that-makes-your-terminal-collaborative-and-team-friendly-would-you-use-it-4lol</guid>
      <description>&lt;p&gt;Hi folks!&lt;/p&gt;

&lt;p&gt;Like any developer, I use my terminal a lot during the day. Recently, I switched from VSCode to Vim so the usage went even up. But when working with my team I often felt like the experience is somewhat broken. Often I found myself copying and sending short command snippets on Slack and then searching for them a few days later, taking a screenshot of my terminal output and sending it to my coworkers, or asking my teammates what version of a CLI tool they are using. This got me inspired to work on this project - a terminal that is more team-centric and collaborative.&lt;/p&gt;

&lt;p&gt;The app is called Sidekick, here is the landing page - &lt;a href="https://getsidekick.app"&gt;https://getsidekick.app&lt;/a&gt;. Sidekick isn't a new terminal emulator. Instead, it's an app that runs alongside your existing terminal emulator. This way you don't have to switch to a new terminal app from your favorite one. Sidekick is something like a command center for your dev team.&lt;br&gt;
Some of the features are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Hassle-free terminal session sharing with your team. It's done through WebRTC and it's collaborative for both sides.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Share &amp;amp; pin commands with your team so you don't have to send it to each other on Slack and then search for it 5 days later.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;See what projects are your teammates working on in the realtime.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;See what tools have your teammates installed and their versions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be able to search in your team's shell history.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I would love to know your feedback on this and learn more about the problems you have when using terminals in your team.&lt;/p&gt;

&lt;p&gt;Happy to answer any questions! Thanks!&lt;/p&gt;

</description>
      <category>terminal</category>
    </item>
  </channel>
</rss>
