<?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: stagefright5</title>
    <description>The latest articles on DEV Community by stagefright5 (@stagefright5).</description>
    <link>https://dev.to/stagefright5</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%2F184334%2F9838208b-91ab-46ea-aa21-94992417c9c3.png</url>
      <title>DEV Community: stagefright5</title>
      <link>https://dev.to/stagefright5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stagefright5"/>
    <language>en</language>
    <item>
      <title>Bye Bye, Annoying Twitter Login Banner!</title>
      <dc:creator>stagefright5</dc:creator>
      <pubDate>Fri, 23 Dec 2022 20:09:04 +0000</pubDate>
      <link>https://dev.to/stagefright5/bye-bye-annoying-twitter-login-banner-4apo</link>
      <guid>https://dev.to/stagefright5/bye-bye-annoying-twitter-login-banner-4apo</guid>
      <description>&lt;h3&gt;
  
  
  TL;DR
&lt;/h3&gt;

&lt;p&gt;Extension that hides login banner on twitter website: &lt;a href="https://chrome.google.com/webstore/detail/toggle-twitter-login-bann/knepanacipkghjjodojlhlapdcloaipj?hl=en&amp;amp;authuser=2" rel="noopener noreferrer"&gt;Chrome Web Store Link&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why
&lt;/h3&gt;

&lt;p&gt;You must have observed that when you visit &lt;a href="https://www.twitter.com" rel="noopener noreferrer"&gt;twitter&lt;/a&gt;, when not logged in, an annoying blue bottom banner appears in your face, asking you to log in.&lt;/p&gt;

&lt;p&gt;If you are like me, you probably don't want to login just to see a public post. Also, the login banner is so annoying.&lt;/p&gt;

&lt;p&gt;So, I built an extension just for this.&lt;/p&gt;

&lt;h3&gt;
  
  
  What does this do?
&lt;/h3&gt;

&lt;p&gt;It hides that bottom banner based on your preference. That's it.&lt;br&gt;
If you want to login, you can easily unhide it and login. &lt;/p&gt;

&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Hide/Show the bottom login banner in &lt;a href="https://www.twitter.com" rel="noopener noreferrer"&gt;https://www.twitter.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Persist this setting across browser restarts&lt;/li&gt;
&lt;li&gt;Hide/Show state is synchronized across different tabs and windows where twitter.com is open ON THE SAME DEVICE &lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;When the banner is NOT hidden&lt;br&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%2Fxemx70kn7b019ocajd3v.png" 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%2Fxemx70kn7b019ocajd3v.png" alt="Screenshot (19) - 1" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When the banner is hidden&lt;br&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%2Fx506r7xbiu8c0pk8g09n.png" 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%2Fx506r7xbiu8c0pk8g09n.png" alt="Screenshot (18) - 1" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the source code: &lt;a href="https://github.com/stagefright5/remove-twitter-login-banner" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Update:
&lt;/h4&gt;

&lt;p&gt;Extension is published now! &lt;a href="https://chrome.google.com/webstore/detail/toggle-twitter-login-bann/knepanacipkghjjodojlhlapdcloaipj?hl=en&amp;amp;authuser=2" rel="noopener noreferrer"&gt;Chrome Web Store Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also install locally by cloning the repo. &lt;a href="https://github.com/stagefright5/remove-twitter-login-banner#how-to-install" rel="noopener noreferrer"&gt;Click here for the guide&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;I have submitted the extension for reviewing to publish it to the Chrom web store.&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;I will update this post with the link when it gets reviewed and accepted. Did not expect the process of publishing to chrome web store to be so long and tedious!&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;Also, this is my first browser extension. So, it might have weird non standard code.&lt;/p&gt;

</description>
      <category>mobile</category>
      <category>discuss</category>
    </item>
    <item>
      <title>@All WebDevs - Please Remove Your Type Definitions From the Top of The Page</title>
      <dc:creator>stagefright5</dc:creator>
      <pubDate>Mon, 06 Sep 2021 05:33:09 +0000</pubDate>
      <link>https://dev.to/stagefright5/all-webdevs-please-remove-your-type-definitions-from-the-top-of-the-page-37lo</link>
      <guid>https://dev.to/stagefright5/all-webdevs-please-remove-your-type-definitions-from-the-top-of-the-page-37lo</guid>
      <description>&lt;p&gt;It gets in the way of reading the code. It's mostly not helpful if I'm trying to get the gist of the code.&lt;br&gt;
Please move it to the end of the file or maintain it in a separate file.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>typings</category>
    </item>
    <item>
      <title>Wierd Async/Await Behaviour in JS 🤔</title>
      <dc:creator>stagefright5</dc:creator>
      <pubDate>Tue, 15 Jun 2021 08:48:53 +0000</pubDate>
      <link>https://dev.to/stagefright5/async-await-behaviour-in-js-is-wierd-17al</link>
      <guid>https://dev.to/stagefright5/async-await-behaviour-in-js-is-wierd-17al</guid>
      <description>&lt;p&gt;Apparently the non async code inside an &lt;code&gt;async&lt;/code&gt; function will execute synchronously even if you don't &lt;code&gt;await&lt;/code&gt;.&lt;br&gt;
Consider this code example:&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="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;adsasdasd&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// note that it is not `await`ed&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;000&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;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;g&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// calling `f`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I always thought it would produce this output:&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="mi"&gt;000&lt;/span&gt;
&lt;span class="nx"&gt;g&lt;/span&gt; &lt;span class="nx"&gt;adsasdasd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;BUT, the actual output is like this&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="nx"&gt;g&lt;/span&gt; &lt;span class="nx"&gt;adsasdasd&lt;/span&gt; &lt;span class="c1"&gt;// function `g` is executed first!!&lt;/span&gt;
&lt;span class="mi"&gt;000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Can anyone explain this?&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>es8</category>
      <category>quirk</category>
    </item>
    <item>
      <title>How to ultra-over-engineer a useless piece of software (or why human interaction is important)</title>
      <dc:creator>stagefright5</dc:creator>
      <pubDate>Wed, 07 Apr 2021 22:51:22 +0000</pubDate>
      <link>https://dev.to/stagefright5/uninit-how-to-ultra-over-engineer-a-buggy-and-useless-piece-of-software-4858</link>
      <guid>https://dev.to/stagefright5/uninit-how-to-ultra-over-engineer-a-buggy-and-useless-piece-of-software-4858</guid>
      <description>&lt;p&gt;&lt;sup&gt;(cover image: from &lt;a href="https://twitter.com/jerome_etienne/status/578591043093835776/photo/1" rel="noopener noreferrer"&gt;here&lt;/a&gt;)&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;This is the story of the of the most useless (may be) npm package. I am warning you that this will be a waste of time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why?
&lt;/h2&gt;

&lt;p&gt;Whenever I wanted to setup a new project, I used to always run these commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init .
git add .
git commit -m "Initial commit"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, I thought of automating it.&lt;/p&gt;

&lt;p&gt;I thought of writing a tool (FML 🤦‍♂️!) that could execute a series of commands.&lt;/p&gt;

&lt;p&gt;ENTER THE &lt;code&gt;Uninit&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it work?
&lt;/h2&gt;

&lt;p&gt;This will basically read a &lt;code&gt;json&lt;/code&gt; file that has a &lt;code&gt;schema&lt;/code&gt; object. This &lt;code&gt;schema&lt;/code&gt; object should have key-value pairs of schemas.&lt;/p&gt;

&lt;p&gt;User can select a &lt;code&gt;schema&lt;/code&gt; by passing a cli argument (&lt;code&gt;-l&lt;/code&gt;) that points to the &lt;code&gt;json&lt;/code&gt; file containing schemas as key-value pairs:&lt;br&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fstagefright5%2Funinit%2Fmaster%2Fimages%2Fselect-schema-no-confirm.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%2Fraw.githubusercontent.com%2Fstagefright5%2Funinit%2Fmaster%2Fimages%2Fselect-schema-no-confirm.png" alt="Select Schema"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;&lt;code&gt;--skip-confirm=true&lt;/code&gt; option is passed. Otherwise, user has to confirm the execution of each task.   &lt;/p&gt;

&lt;p&gt;This is a sample &lt;code&gt;schema&lt;/code&gt; object. Here, there are &lt;code&gt;tasks&lt;/code&gt; that will run sequentially, when the schema is run:  &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%2Fraw.githubusercontent.com%2Fstagefright5%2Funinit%2Fmaster%2Fimages%2Fschema-npm-git-init.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%2Fraw.githubusercontent.com%2Fstagefright5%2Funinit%2Fmaster%2Fimages%2Fschema-npm-git-init.png" alt="Sample Schema Object"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;This is how the &lt;code&gt;task&lt;/code&gt;s are run sequentially:&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%2Fraw.githubusercontent.com%2Fstagefright5%2Funinit%2Fmaster%2Fimages%2Frunning-schema-npm-git-init-no-confirm.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%2Fraw.githubusercontent.com%2Fstagefright5%2Funinit%2Fmaster%2Fimages%2Frunning-schema-npm-git-init-no-confirm.png" alt="Tasks Execution"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;Observe the last task (no. 4). This task's &lt;code&gt;command&lt;/code&gt; has placeholders&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;${commit_head}&lt;/code&gt; and&lt;/li&gt;
&lt;li&gt;&lt;code&gt;${commit_body}&lt;/code&gt;&lt;/li&gt;
&lt;/ul&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%2Fraw.githubusercontent.com%2Fstagefright5%2Funinit%2Fmaster%2Fimages%2Fplaceholder-task.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%2Fraw.githubusercontent.com%2Fstagefright5%2Funinit%2Fmaster%2Fimages%2Fplaceholder-task.png" alt="Tasks Execution"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, the tool will &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parse the command&lt;/li&gt;
&lt;li&gt;Take the values for each of the placeholder from the user (you can see something like, "Value for placeholder_0" in the image)&lt;/li&gt;
&lt;li&gt;Replace the placeholders with these values&lt;/li&gt;
&lt;li&gt;Execute the replaced command (Here, &lt;code&gt;git commit -m "This is commit header" -m "This is detailed commit descriptions"&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Structure Of Schema (You can skip and go to PS)
&lt;/h2&gt;

&lt;p&gt;Each schema has the folowing structure: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;description(&lt;code&gt;string&lt;/code&gt;): Describes the schema&lt;/li&gt;
&lt;li&gt;tasks(&lt;code&gt;Array&amp;lt;{name: string, command: string}&amp;gt;&lt;/code&gt;): &lt;code&gt;name&lt;/code&gt; property is a unique id for this object task object. 
&lt;code&gt;command&lt;/code&gt; is the command to execute. &lt;code&gt;command&lt;/code&gt; can take user inputs.
If there is any placeholder in the string(in this form: &lt;code&gt;${user_input_1}&lt;/code&gt;), then the tool will parse it and asks the user for input for each of the placeholder.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  PS
&lt;/h2&gt;

&lt;p&gt;You might be thinking,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Why The F, would I ever use this instead of a simple shell script! This is a completely useless piece Of Sh*t!"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And, you would be &lt;strong&gt;ABSOLUTELY&lt;/strong&gt; right.&lt;/p&gt;

&lt;p&gt;This whole exercise made me realize why you should say your "awesome" ideas out loud, preferably, to other human beings.&lt;/p&gt;

&lt;p&gt;Anyway,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Here is the repo: &lt;a href="https://github.com/stagefright5/uninit" rel="noopener noreferrer"&gt;https://github.com/stagefright5/uninit&lt;/a&gt; (if you want to explore the code of this amazing software), and&lt;/li&gt;
&lt;li&gt;NPM Link: &lt;a href="https://www.npmjs.com/package/uninit" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/uninit&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>overengineering</category>
      <category>useless</category>
      <category>npm</category>
      <category>package</category>
    </item>
  </channel>
</rss>
