<?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: Backlog Slayer</title>
    <description>The latest articles on DEV Community by Backlog Slayer (@mykeels).</description>
    <link>https://dev.to/mykeels</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%2F29776%2F5cd98604-48ec-48f0-9659-262c148d5047.jpg</url>
      <title>DEV Community: Backlog Slayer</title>
      <link>https://dev.to/mykeels</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mykeels"/>
    <language>en</language>
    <item>
      <title>Dev Dependency Day</title>
      <dc:creator>Backlog Slayer</dc:creator>
      <pubDate>Thu, 18 Jul 2019 22:09:05 +0000</pubDate>
      <link>https://dev.to/mykeels/dev-dependency-day-15i8</link>
      <guid>https://dev.to/mykeels/dev-dependency-day-15i8</guid>
      <description>&lt;p&gt;Earlier today, I made &lt;a href="https://twitter.com/mykeels/status/1151807794875699200?s=19"&gt;this tweet&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;We need a developer holiday.

I propose Dependency Day.

A day in the year, when we fix all project dependency issues on the Github projects we manage.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It wasn't well received, of course, because "a holiday should be for resting".&lt;/p&gt;

&lt;p&gt;I know this borders on unrealistic, but I'd like to make my case anyway. &lt;/p&gt;




&lt;p&gt;If you're like me, you already have a ton of emails from Github about projects you manage, that have security issues because of its dependencies.&lt;/p&gt;

&lt;p&gt;For some reason, this is targeted at JavaScript devs, and NPM tries to make fixing this easy by offering the &lt;code&gt;npm audit&lt;/code&gt; command, which shows you which packages have security issues, and &lt;code&gt;npm audit fix&lt;/code&gt; which attempts to automatically bump up the dependency versions to values where those security issues no longer exist.&lt;/p&gt;

&lt;p&gt;One problem with that, is the higher versions your dependency gets bumped to, might be incompatible with your code, so you might need to check the docs to figure out what changes are necessary to keep your code working.&lt;/p&gt;

&lt;p&gt;Another problem arises when there's no higher version of a dependency that resolves the security issue. Perhaps, because the developer is like us, and hasn't made out time for a fix. This is a bigger challenge, because now you have to raise an issue and wait for a reply, or make a PR and hope it gets attended to.&lt;/p&gt;

&lt;p&gt;But if every developer got 24 hours without office work, dedicated to resolving these issues, I imagine it would be really helpful. I wonder what the internet thinks.&lt;/p&gt;

</description>
      <category>holiday</category>
      <category>githubprojectdependencyfix</category>
    </item>
    <item>
      <title>Why is Slack changing its internals?</title>
      <dc:creator>Backlog Slayer</dc:creator>
      <pubDate>Mon, 15 Jul 2019 18:01:18 +0000</pubDate>
      <link>https://dev.to/mykeels/why-is-slack-changing-its-internals-4p4c</link>
      <guid>https://dev.to/mykeels/why-is-slack-changing-its-internals-4p4c</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.to/changoman/easy-dark-mode-for-slack-1mmn"&gt;This post&lt;/a&gt; by &lt;a class="mentioned-user" href="https://dev.to/changoman"&gt;@changoman&lt;/a&gt;
 inspired many tools for changing Slack's visual themes.&lt;/p&gt;

&lt;p&gt;It used to be fairly easy to find and edit Slack's ssb-interop.js file, to load a custom CSS which would change the way it looked.&lt;/p&gt;

&lt;p&gt;With the recent release of v4.0, the file is gone, and exists as a bundled file within &lt;code&gt;app.asar&lt;/code&gt;, a compressed file.&lt;/p&gt;

&lt;p&gt;To achieve the same functionality, you'd have to extract &lt;code&gt;app.asar&lt;/code&gt; into a folder, edit the &lt;code&gt;dist/ssb-interop.bundle.js&lt;/code&gt; file, and compress the folder back into &lt;code&gt;app.asar&lt;/code&gt; before restarting the application.&lt;/p&gt;

&lt;p&gt;This means, that Slack's program loads content from the compressed file. &lt;/p&gt;

&lt;p&gt;I wonder what the benefits of such an arrangement would be to Slack's internal architecture. Does anyone know?&lt;/p&gt;

</description>
      <category>question</category>
      <category>slack</category>
      <category>asar</category>
      <category>electron</category>
    </item>
    <item>
      <title>PHP: Testing only changes</title>
      <dc:creator>Backlog Slayer</dc:creator>
      <pubDate>Fri, 13 Jul 2018 09:21:03 +0000</pubDate>
      <link>https://dev.to/mykeels/php-testing-only-changes-1a8g</link>
      <guid>https://dev.to/mykeels/php-testing-only-changes-1a8g</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmausatf.com%2Fwp-content%2Fuploads%2F2015%2F05%2Fchange_sign1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmausatf.com%2Fwp-content%2Fuploads%2F2015%2F05%2Fchange_sign1.jpg" alt="changes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;center&gt;&lt;small&gt;&lt;u&gt;Ref: [USATF Mid-Atlantic](https://mausatf.com/background-screening-process-changes/)&lt;/u&gt;&lt;/small&gt;&lt;/center&gt;

&lt;p&gt;I recently found &lt;a href="https://github.com/IcyApril/WhatsChanged" rel="noopener noreferrer"&gt;this awesome 😍 tool&lt;/a&gt; that let me run tests on only files that have been modified since the last commit, like I'm familiar with in &lt;a href="https://jestjs.io" rel="noopener noreferrer"&gt;the Jest framework&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Because I couldn't find a way to do this with &lt;a href="https://github.com/spatie/phpunit-watcher" rel="noopener noreferrer"&gt;PHPUnit Watcher&lt;/a&gt; or PHPUnit itself, and it worked for me with a few minor blocks, I have decided to share. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you know how, please tell me in the comments.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The Blocker
&lt;/h3&gt;

&lt;p&gt;The package's PHPUnit dependency was marked as &lt;code&gt;^6.0&lt;/code&gt;, so it wasn't working on my project, which had a dependency marked as &lt;code&gt;^7.0&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Fix
&lt;/h3&gt;

&lt;p&gt;I've made a fork &lt;a href="https://github.com/mykeels/WhatsChanged" rel="noopener noreferrer"&gt;here&lt;/a&gt; and I use its &lt;code&gt;dev-master&lt;/code&gt; branch in my project by adding it to &lt;code&gt;composer.json&lt;/code&gt; like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"repositories"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vcs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/mykeels/WhatsChanged"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"require-dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"icyapril/whats-changed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dev-master"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is so that composer &lt;a href="https://stackoverflow.com/a/13500676/7396801" rel="noopener noreferrer"&gt;resolves the package from my GitHub fork&lt;/a&gt; rather than use the official package. &lt;/p&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;Now, when run &lt;code&gt;./vendor/bin/whatschanged&lt;/code&gt;, I get:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tests/Feature/AuthTest.php     OK &lt;span class="o"&gt;(&lt;/span&gt;3 tests, 6 assertions&lt;span class="o"&gt;)&lt;/span&gt;
tests/Feature/IntentTest.php   OK &lt;span class="o"&gt;(&lt;/span&gt;5 tests, 21 assertions&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;rather than&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F11996508%2F42683545-85d8f218-8685-11e8-8762-82ec753a8497.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F11996508%2F42683545-85d8f218-8685-11e8-8762-82ec753a8497.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🎉💃 Happy Coding!&lt;/p&gt;

</description>
      <category>phpunit</category>
      <category>changes</category>
      <category>testing</category>
      <category>composer</category>
    </item>
    <item>
      <title>Reading Passwords from STDIN in PHP</title>
      <dc:creator>Backlog Slayer</dc:creator>
      <pubDate>Wed, 04 Jul 2018 12:41:50 +0000</pubDate>
      <link>https://dev.to/mykeels/reading-passwords-from-stdin-in-php-1np9</link>
      <guid>https://dev.to/mykeels/reading-passwords-from-stdin-in-php-1np9</guid>
      <description>&lt;p&gt;Hi Everyone,&lt;/p&gt;

&lt;p&gt;Recently, I had to create an &lt;a href="https://laravel.com/docs/5.6/artisan" rel="noopener noreferrer"&gt;artisan command&lt;/a&gt; that submitted some data on behalf of a user. &lt;/p&gt;

&lt;p&gt;I needed it to have access to the user's password to do that.&lt;/p&gt;

&lt;p&gt;My first thought was to store the password in an environment variable. I really did not want to do that, and preferred to make the user of the script enter the password every time it was necessary.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffuf0mk9ob63gjcd9qro2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffuf0mk9ob63gjcd9qro2.jpg" width="596" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;center&gt;&lt;small&gt;&lt;u&gt;[Secure Password Prompt](http://osxdaily.com/2015/02/04/terminal-wont-show-password-when-typed)&lt;/u&gt;&lt;small&gt;&lt;/small&gt;&lt;/small&gt;&lt;/center&gt;

&lt;h2&gt;
  
  
  How it was done
&lt;/h2&gt;

&lt;p&gt;It was important to ensure that the password was entered securely (invisible too), so I looked into how to and here's what I came up with.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;getPassword&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Enter Password:"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$prompt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nb"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'stty -echo'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nv"&gt;$password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;fgets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;STDIN&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

    &lt;span class="nb"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'stty echo'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$password&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How I understand it
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;stty&lt;/code&gt; command, as I understand it now &lt;a href="https://www.thinkage.ca/gcos/expl/stty.html" rel="noopener noreferrer"&gt;sets the terminal properties&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;stty -echo&lt;/code&gt; sets the &lt;code&gt;echo&lt;/code&gt; property to false, so the terminal will NOT echo the input it receives to the screen, rendering the password invisible&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;fgets(...)&lt;/code&gt; retrieves input from a stream interface (STDIN).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;STDIN&lt;/code&gt; is the &lt;a href="https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)" rel="noopener noreferrer"&gt;input stream&lt;/a&gt; that &lt;code&gt;fgets&lt;/code&gt; reads the input from &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;stty echo&lt;/code&gt; restores the &lt;code&gt;echo&lt;/code&gt; property to true, so we can now see output on the screen again&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope you learned something from this, as I did. Happy Coding. 😍&lt;/p&gt;

</description>
      <category>php</category>
      <category>passwords</category>
      <category>security</category>
      <category>stdin</category>
    </item>
  </channel>
</rss>
