<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sanidhya Rai on Medium]]></title>
        <description><![CDATA[Stories by Sanidhya Rai on Medium]]></description>
        <link>https://medium.com/@san1dhya?source=rss-646a6dfe682a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AVyKuMVJzoiEOPFryulE7Q.jpeg</url>
            <title>Stories by Sanidhya Rai on Medium</title>
            <link>https://medium.com/@san1dhya?source=rss-646a6dfe682a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:34:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@san1dhya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Project Automation with Bash]]></title>
            <link>https://medium.com/fasal-engineering/project-automation-with-bash-f2edc8f8b7a0?source=rss-646a6dfe682a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2edc8f8b7a0</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[bash-script]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Sanidhya Rai]]></dc:creator>
            <pubDate>Thu, 23 Dec 2021 06:30:21 GMT</pubDate>
            <atom:updated>2021-12-23T06:30:21.725Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eSGNRPjuXtF7FRhUf-P-eg.jpeg" /></figure><p>How often does it happen that you have a project set up and you need to add a new feature? Going through the same monotonous method of creating a sub-directory, creating new files with the same old boring naming convention, etc.</p><p>Let alone one project, what if your “new bug” (everyone hopes that it’s not a bug) has a dependency on multiple projects. You could make the optimizations and common out anything and everything, but what about the cumbersome process that hasn’t evolved yet.</p><h4>Where am I heading with this?</h4><p>Those who use frameworks to create new projects are aware of the fact that they all have built-in utilities to create a new one with default template at just the user’s whim. These utilities not only cover just the initial settings but the directories, boilerplate code, and all sorts of comments and hints.</p><p>Wouldn’t you wish if you could just</p><pre>npm init -y </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*126gGxiTu6cc13Jf3m2FeA.jpeg" /></figure><p>and be done with everything? Yes, I understand how you feel. Been there done that.</p><p>Well, I have blabbered enough, let us skip to the good part.</p><h4>What got me started, and why bash?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*gPouUIoiCdymibo31s_iIw.jpeg" /></figure><p>As I earlier mentioned, doing a repetitive task without optimization in programming is a blunder and a cardinal sin. So I just wanted to automate what kept repeating. As simple as that.</p><p>Primarily, it was navigating to a certain directory, creating a sub-directory, then adding files. Then it increased to four repositories at once. Having worked with Linux before, I recalled that bash has every utility that I needed. Creating directories with sub-directories, creating files, adding context to files, resolving dynamic data with variables, deletion, git operation, and just way too many things to mention here.</p><h4>Let me get you started!</h4><p><strong>Creating a setup<br></strong>Since we aren’t working with node, but rather a dummy project, we’ll just proceed with dummy folders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*AkyJo6sAGhSsYx03WZCjIw.jpeg" /><figcaption>Project Structure</figcaption></figure><p>Here, we have our parent folder: Automation, with two sub-directories: Vegetables and Fruits, which have their own file needs and identifiers. At the same level, we have our Automator which will store the script and code templates for respective files.</p><p><strong>Tools we will be using<br></strong>- Bash<br>- Perl<br>- Cat<br>- Eval<br>- Awk/ Sed<br>- Npx on global user<br>- Git (Optional)</p><p>A lot of tools are redundant and may do exactly what you want to achieve without incorporating all of them, but it is essential to consider the complexity and time before you dive into it.</p><p>I use macOS for development and it ships with ‘<em>zsh</em>’ and ‘<em>bash@3.2</em>’. It is imperative to decide on either bash or Z shell before we proceed because it makes a huge difference on what and how we use them — syntactically and functionality-wise as well. For more context, you can refer to the blog below: -</p><blockquote><a href="https://medium.com/@harrison.miller13_28580/bash-vs-z-shell-a-tale-of-two-command-line-shells-c65bb66e4658"><em>https://medium.com/@harrison.miller13_28580/bash-vs-z-shell-a-tale-of-two-command-line-shells-c65bb66e4658</em></a></blockquote><p>Adding on to why it is complex, for one, macOS ships with FreeBSD and not the GNUBash@5, so a lot of syntaxes vary. Second, awk/ sed behave differently in both variants. So it becomes taxing to build on. Another possibility to consider is the types of users who’d be using it, for example, a group of people can either use Linux or macOS. So a solution that caters to either group is preferred.</p><p>Hence, I chose ‘bash’ over ‘zsh’. But since FreeBSD has its own ‘sed’, the functionalities differ as well. So to overcome them, I am using ‘awk’ and ‘Perl’.</p><p>Next, we shall create a script inside our ‘Automator’ directory — <em>setup.sh</em>. But only creating the file isn’t enough, we have to make it executable.</p><pre><strong><em>Create setup.sh: -<br></em></strong>touch Automator/setup.sh</pre><pre><strong><em>Make it executable: -<br></em></strong>chmod +x Automator/setup.sh</pre><p>Now we will open our <em>setup.sh</em> script and start adding logic and flow to it.<br>As you can see below, the first line is called a ‘shebang’, typically used to let the machine know which shell you want to use. It generally is:</p><pre><strong><em>For Bash</em></strong><br>#!/bin/bash</pre><pre><strong><em>For zsh<br></em></strong>#!/bin/zsh</pre><p>Now add the below code to set paths for different parts of the project. We have also added a <em>trap</em> — to record any event of <em>interrupt</em> [ ctrl + c ], whether it is done by the user or the machine. When the interrupt is detected we call the <em>cleanUp</em> function.</p><blockquote>Note: To call a function in shell, we just use it’s name.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/563fb776f4378207d3bba3ed2034f38d/href">https://medium.com/media/563fb776f4378207d3bba3ed2034f38d/href</a></iframe><p>Now that our paths are set, let us ask the user for details.</p><ol><li>Ask whether the model is Fruit or Vegetable.</li><li>Ask the name of the model.</li></ol><p>We will store this info in our variables and use them later to create file names based on them, or we can even export them for others to use, etc.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30c12fdda5c043800668a4709fafe792/href">https://medium.com/media/30c12fdda5c043800668a4709fafe792/href</a></iframe><blockquote>Note: reading a variable only needs you to “read -r VARIABLE_NAME”, but here I am using a while loop to check if varibale has recieved some value other than null. In case it is null then do not let the user proceed until he does enter something.</blockquote><p>There are multiple things that we can do, and various info that we could ask from users. But if we let them input anything and everything they wish, we could end up handling a lot of runtime issues. For example, if an ‘apple’ folder already exists, you wouldn&#39;t want to have another apple folder, but what if someone enters apple as ‘aple’ or ‘appple’? It would lead to creating redundant models. Hence, to limit these mistakes, we can create a list that will hold all options a user can pick from. We can then sort the list and display it as options, if the required option isn’t there, then they can enter manually.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ce3e7423d23a462cd5f0953d142a4d4/href">https://medium.com/media/3ce3e7423d23a462cd5f0953d142a4d4/href</a></iframe><p>Before we proceed, let us talk about templating with bash and the use of variables. To create a new template, create a file with the <em>.tpl</em> extension, and set the path for the same inside the setup. It works best if you have common out code — that reduces the number of templates and the checks you would need to use them.</p><p>So after creating the files for your templates, copy and paste your code inside the template. Any dynamic data that is either dependent on what user enters or can be built up with what user enters, can be used as variables.</p><p>So let’s say your logic makes calls to different collections of a database, and the name of the collection keeps on changing as per the feature you’re adding. Make the name of the collection a variable.</p><pre><strong><em>Instead of<br></em></strong>db.collection(&#39;nameOfCollection&#39;).find({});</pre><pre><strong><em>Use</em></strong><br>db.collection(&#39;${COLLECTION_NAME_VARIABLE}&#39;).find({});</pre><p>Using uppercase for naming the bash variables isn’t a paradigm, but better to use as it stands out from the rest of the code. For a variable to be recognized and evaluated use ‘${VARIABLE}’. Then any available variable inside the script can be used and replaced with their placeholders, using <strong><em>eval</em></strong>.</p><blockquote>Note: $, “” , `` which are prominently used a lot in code, are also part of bash special characters. When using them in your regular code along with templating, escape them using ‘\’, that way bash won’t interfere with them.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c73a0dca834302b12d3d5af7e4bbf41b/href">https://medium.com/media/c73a0dca834302b12d3d5af7e4bbf41b/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/09ff767a2d49c4026f43f413d2cb4006/href">https://medium.com/media/09ff767a2d49c4026f43f413d2cb4006/href</a></iframe><p>Now that our templates are ready, let us evaluate and use them to add new fruit/vegetable inside our project.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec5169c19b42dea6ea6d79a0c62a8886/href">https://medium.com/media/ec5169c19b42dea6ea6d79a0c62a8886/href</a></iframe><blockquote>Note: After everything has been implemented, in order to successfully run the script, we need to set a start point, since everything is modular. At the end of the script, we will add [[ acceptModel “$@” ]], letting shell know where to start from.</blockquote><p>With that done, we have our automaton all set. To use it, change the directory to your parent folder, and execute:</p><pre>[[ parentDirectory]]&gt; ./automator/setup.sh</pre><p>There we have our Automator doing all your boring job.</p><h4>BONUS</h4><p>Now that a project is done, how to handle multiple projects. One way is to have automation scripts for each project. But it is cumbersome and difficult to manage, especially if all share similar data. So, make a master script that accepts all the data, and triggers other scripts from it.</p><pre>|-Master Script<br>    |-ProjectA Script<br>    |-ProjectB Script</pre><p>Thus, covering all projects. To achieve that, add these lines around your variables:</p><pre>set -a<br>variable 1<br>variable 2<br>variable 3<br>variable 4<br>.<br>.<br>.<br>variable n<br>set +a</pre><p>Any data between “set -+ a”, will be shared informally across all children scripts.</p><p><strong>Additional/Optional<br></strong>You can incorporate git functionalities like some are shared above and even make a lazy PR script.</p><blockquote><a href="https://gitbetter.substack.com/p/automate-repetitive-tasks-with-custom">https://gitbetter.substack.com/p/automate-repetitive-tasks-with-custom</a></blockquote><p>If you use node, you can install ‘prettier’ globally, and keep your inserted code formatted as per your team guidelines.</p><blockquote>Thank you for reading all along, if you find this article helpful, upvote.</blockquote><blockquote>Feel free to reach out to me in case of discrepancies or suggestions.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2edc8f8b7a0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fasal-engineering/project-automation-with-bash-f2edc8f8b7a0">Project Automation with Bash</a> was originally published in <a href="https://medium.com/fasal-engineering">Fasal Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why is Flutter a better environment than it’s native competitors?]]></title>
            <link>https://medium.com/fasal-engineering/why-is-flutter-a-better-environment-than-its-native-competitors-4f658bd20f24?source=rss-646a6dfe682a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f658bd20f24</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Sanidhya Rai]]></dc:creator>
            <pubDate>Thu, 15 Apr 2021 11:28:23 GMT</pubDate>
            <atom:updated>2021-04-15T11:28:23.569Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6xT0ZOACZCdy_61tTJ3r1Q.png" /><figcaption>Source: <a href="https://www.emanprague.com/en/blog/lets-develop-a-mobile-app-in-flutter-13/">https://www.emanprague.com/en/blog/lets-develop-a-mobile-app-in-flutter-13/</a></figcaption></figure><h3>Why is Flutter a better choice than its native competitors?</h3><p>It often happens that a new software engineer sets out to explore the most famous and thrilling tech ground — App Development. As easy as it may sound, choosing the right spec sheet and ideology behind building your app is downright difficult. From your initial idea, selecting your target audience to finalising the tech stack required to build it; it all boils down to the requirement and availability of resources.</p><p>Until May 2017, app development had always been dependent on the ‘Native’ development kits released by respective companies — namely Apple for <strong><em>iOS</em></strong> and Google for <strong><em>Android</em></strong>, in addition to various <strong><em>Web </em></strong>development frameworks.</p><h4><strong>What are Native Tools?</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGT5lFNkbnqmMWmLn7kafQ.png" /><figcaption>Source: <a href="https://blog.codemagic.io/uploads/covers/Codemagic-io_Blog_Flutter-Versus-Other-Mobile-Development-Frameworks_1.png">https://blog.codemagic.io/uploads/covers/Codemagic-io_Blog_Flutter-Versus-Other-Mobile-Development-Frameworks_1.png</a></figcaption></figure><p>Native application building refers to developing an app-specific to either iOS, Android, Windows, or Web, etc. making full use of the device’s features, such as gyroscope, accelerometer, camera, microphone to name a few. Some of the commonly used frameworks and programming languages are:-</p><p><strong>iOS:</strong> Swift, Objective-C, and Xcode</p><p><strong>Android:</strong> Kotlin, Java, and Android Studio</p><p><strong>Web: </strong>HTML, CSS, JavaScript, and now with the support of various other languages and frameworks like Cordova, etc.</p><h3><strong>What is Flutter?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*74ZGnSYUDf_Q687MBqQGzQ.png" /><figcaption>Source: <a href="https://www.signitysolutions.com/blog/level-mobile-app-development-2020-flutter/">https://www.signitysolutions.com/blog/level-mobile-app-development-2020-flutter/</a></figcaption></figure><blockquote>As described by Google, Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for <a href="https://flutter.dev/docs">mobile</a>, <a href="https://flutter.dev/web">web</a>, and <a href="https://flutter.dev/desktop">desktop</a> from a single codebase.</blockquote><p>Flutter is an <a href="https://opensource.org/"><em>open-source</em></a><em>, </em><a href="https://medium.com/@hakanasal51/what-is-cross-platform-software-38ee57b7304a"><em>cross-platform</em></a><em> </em>framework that not only has optimised and great libraries but is also supported and contributed by a team of Google Developers and a vast community. For app developers, it means, a vast array of features and unending support from people who are always looking out for improving the framework.</p><h3>What would you get by using Flutter?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rw2WpA5hmp_WwpDXXNihbg.png" /><figcaption>Source: <a href="https://blog.codemagic.io/uploads/covers/Codemagic-io_Blog_Flutter-Versus-Other-Mobile-Development-Frameworks_1.png">https://blog.codemagic.io</a></figcaption></figure><h4>1. Release from the same code base</h4><p>If you have ever worked on native apps before, you would be well versed with the struggles of maintaining different code bases for different environments i.e. separate source for iOS, Android, Windows, Linux, and Web, hence, complicating and making everything go haywire.</p><p>The best feature that flutter comes along with is its <strong><em>cross-platform functionality</em></strong> i.e. using the same code base to compile the code into different native apps. You can have the same business logic, same dependencies, and different engineers contributing to the same code, compiled into various platform apps.</p><h4>2. Great performance</h4><p>Flutter uses Dart by Google, Dart is a client-optimized language for fast apps on any platform, which is solely based on making responsive and optimised UI. Dart offers complete and mature <a href="https://dart.dev/codelabs/async-await"><em>async-await</em></a> along with <a href="https://dart.dev/guides/language/language-tour#isolates"><em>isolate-based concurrency</em></a>. With the familiarity of syntaxes from different languages, Dart is also easier to learn.</p><p>It directly compiles into native code. Since it comes with its very own widget library, dart doesn’t need to access OEM widgets, which means, less mediated communication between app and platform. With the recent addition of <a href="https://dart.dev/null-safety"><em>null-safety</em></a><em>, </em>Dart is inevitably a strong language — resulting in faster startup time and fewer performance issues.</p><h4>3. Faster and simple development</h4><p>One of the most applauded features of flutter is <strong><em>hot reload</em></strong>, which allows you to directly load and view any new changes to the app without re-building it entirely: on emulators, simulators, and hardware. In a few seconds, the code will reload while the app is running, without having to restart it. This isn’t great just for adding features or improvising, but also for bug fixing.</p><h4>4. Compatibility</h4><p>As mentioned earlier, Dart has its own widgets and doesn’t have to interact with OEM widgets, there will be no compatibility issues in terms of widgets with different OS versions.</p><h4>5. Open source</h4><p>Both Flutter and Dart are open-source, hence there is a huge community and extensive documents out there to help you on your way.</p><h4>6. Solid Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gsJWkyGRYpV1aLNq3JbCpg.png" /><figcaption>Source: <a href="https://flutter.dev/docs/resources/architectural-overview">https://flutter.dev</a>/</figcaption></figure><p>Flutter uses Dart which has an enormous component library built-in, resulting in a bigger size but often does not require a bridge to communicate with native modules. Dart has various frameworks — covering almost every required tech stack to develop an app. In addition to it, Flutter uses Skia C++ engine, which has all protocols, channels, and compositions defined. Hence, giving you a full-fledged environment without worrying about a single add-on.</p><h4>7. Build and release</h4><p>Flutter has a very strong command line; it allows us to create a binary or an executable of the app. Following the docs, we can also release it for <a href="https://flutter.dev/docs/deployment/android">Android</a>, <a href="https://flutter.dev/docs/deployment/ios">iOS</a>, Windows, <a href="https://flutter.dev/docs/deployment/linux">Linux</a>, and <a href="https://flutter.dev/docs/deployment/web">Web</a> bundle respectively. Flutter has also officially added docs for continuous delivery with ‘<a href="https://flutter.dev/docs/deployment/cd"><em>fastlane</em></a><em>’.</em></p><h3>Conclusion</h3><p>Since its inception in May 2017, Flutter has rooted itself in the tech world and will continue to grow. It had already declared itself to be a much-needed tool in 2020, with more and more advancement on its way — Flutter is bound to become ‘one of the best tools, if not ‘the best, that you would want in your arsenal.</p><blockquote>Also, do not forget that Google has Fuchsia, an open-source OS coming up, a multipurpose OS which can be used for mobile, PC, TV and embedded systems. Flutter was developed keeping Fuchsia in mind. Hence, is a tool that can no longer be ignored.</blockquote><blockquote>Thank you for reading the article. Feel free to connect with us!</blockquote><p>Also Read —</p><p><a href="https://medium.com/fasal-engineering/making-your-meteor-node-app-fly-part-1-server-response-time-optimization-42993fe34bf4">Making your meteor node app fly part-2: Server response time optimization</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f658bd20f24" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fasal-engineering/why-is-flutter-a-better-environment-than-its-native-competitors-4f658bd20f24">Why is Flutter a better environment than it’s native competitors?</a> was originally published in <a href="https://medium.com/fasal-engineering">Fasal Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>