<?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 Akshay Kadam on Medium]]></title>
        <description><![CDATA[Stories by Akshay Kadam on Medium]]></description>
        <link>https://medium.com/@deadcoder0904?source=rss-784e5fbd9c36------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DcXNjUHkkzZXeUNeKdd7uA.jpeg</url>
            <title>Stories by Akshay Kadam on Medium</title>
            <link>https://medium.com/@deadcoder0904?source=rss-784e5fbd9c36------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 09:12:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@deadcoder0904/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[Getting Started with the Prisma Framework (formerly Prisma 2) in React Native]]></title>
            <link>https://heartbeat.comet.ml/getting-started-with-the-prisma-framework-formerly-prisma-2-in-react-native-3055ed122b5c?source=rss-784e5fbd9c36------2</link>
            <guid isPermaLink="false">https://medium.com/p/3055ed122b5c</guid>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[prisma]]></category>
            <category><![CDATA[heartbeat]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Akshay Kadam]]></dc:creator>
            <pubDate>Fri, 15 Nov 2019 15:16:01 GMT</pubDate>
            <atom:updated>2021-09-28T19:44:16.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lEdae8lMaQxN2Q1OUGYqUw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@marcojodoin?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Marc-Olivier Jodoin</a> on <a href="https://unsplash.com/s/photos/reflection?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><blockquote>The Prisma Framework is a rewrite of Prisma, which replaced traditional ORMs and simplified database workflows by providing type-safe database access with the auto-generated Prisma client. It also made it easy to data model applications declaratively, and it provided an easy way to manage data through Prisma Admin.</blockquote><p>But there was one major issue with Prisma. It had to be run through JVM and had memory issues. The Prisma Framework is rewritten in Rust, and it addresses the issues from Prisma 1.</p><p>Prisma 1 also required a server in front of your backend server, while with the Prisma Framework, the query engine is now a bundled executable that’s run alongside the backend on the same server.</p><h4>The Prisma Framework consists of 2 standalone tools to tackle the problems of data access and migrations:</h4><ul><li><a href="https://photonjs.prisma.io/">Photon</a>: Type-safe and auto-generated database client (“ORM replacement”)</li><li><a href="https://lift.prisma.io/">Lift</a>: Declarative migration system with custom workflows</li></ul><p>Photon is a type-safe database client that replaces traditional ORMs, and Lift allows us to create data models declaratively and perform database migrations.</p><p>The Prisma Framework also consists of <a href="https://github.com/prisma/studio">Studio</a>, which provides an Admin UI to support various database workflows.</p><p>So let&#39;s get started with building a server with <a href="https://github.com/prisma/prisma2">the Prisma Framework</a>. We’ll be making a Programming Quotes App, so we’ll need to make a server that provides Programming Quotes.</p><p>You can find the complete code at the following GitHub repo:</p><p><a href="https://github.com/deadcoder0904/ProgrammingQuotes">deadcoder0904/ProgrammingQuotes</a></p><h3>Prerequisites</h3><p>For this tutorial, you need a basic knowledge of <a href="https://facebook.github.io/react-native/">React Native</a>. You also need to understand <a href="https://reactjs.org/docs/hooks-intro.html">React Hooks</a>.</p><p>Since this tutorial is primarily focused on Prisma, it’s assumed that you already have a working knowledge of React and its basic concepts.</p><p>If you do not have a working knowledge of the above content, don’t worry. There are tons of tutorials available that will make you prepared to follow this post.</p><p>Throughout the course of this tutorial, we’ll be using yarn. If you don&#39;t have yarn already installed, install it <a href="https://yarnpkg.com/en/docs/install">here</a>.</p><p>To make sure we’re on the same page, these are the versions used in this tutorial:</p><ul><li>Node v12.11.1</li><li>npm v6.11.3</li><li>npx v6.11.3</li><li>yarn v1.19.1</li><li>prisma2 v2.0.0-preview015</li><li>react-native-cli: 2.0.1</li><li>react-native: 0.61.2</li></ul><h3>Backend (Server Side)</h3><p>Start a new Prisma 2 project by using the <a href="https://github.com/npm/npx">npx</a> command as follows:</p><pre>$ npx prisma2 init server</pre><p>Alternatively, you can install the prisma2 CLI globally and then run the init command:</p><pre>$ yarn global add prisma2 // or npm install --global prisma2</pre><pre>$ prisma2 init server</pre><h3>Run the interactive `prisma2 init` flow &amp; select boilerplate</h3><p>Select the following in the interactive prompts:</p><p>1. Select <strong>Starter Kit</strong></p><p>2. Select <strong>JavaScript</strong></p><p>3. Select <strong>GraphQL API</strong></p><p>4. Select <strong>SQLite</strong></p><p>Once terminated, the init command will have created an initial project setup in the server/ folder.</p><p>Now, open the schema.prisma file and replace it with the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89fa0004de0ca63ad80f303257aba376/href">https://medium.com/media/89fa0004de0ca63ad80f303257aba376/href</a></iframe><p>schema.prisma contains the data model as well as the configuration options.</p><p>Here, we specify that we want to connect to the SQLite Datasource called dev.db as well as target code generators like the photonjs generator.</p><p>Then, we define the data model Quote, which consists of id, author, and content.</p><ul><li>id is a primary key of type String with a default value of <a href="https://github.com/ericelliott/cuid">cuid()</a>.</li><li>author is of type String.</li><li>content is of type String but with a constraint that it must be unique.</li></ul><p>Now go ahead and create a quotes.json file in the prisma/ directory and paste the following into the quotes.json file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/557987b01b85fd0f4cf60559b7636349/href">https://medium.com/media/557987b01b85fd0f4cf60559b7636349/href</a></iframe><p>The seed.js file should look like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5fe41f1dc3229e444a2808ed2ac27794/href">https://medium.com/media/5fe41f1dc3229e444a2808ed2ac27794/href</a></iframe><p>This file takes the dummy data from the quotes.json file and adds it to the SQLite database.</p><p>Now go inside the src/index.js file and remove its contents. We&#39;ll start adding content from scratch.</p><p>First, go ahead and import the necessary packages and declare some constants:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/91e8ab9ddffa8cd4dbf507e29332ec3a/href">https://medium.com/media/91e8ab9ddffa8cd4dbf507e29332ec3a/href</a></iframe><p>We have declared a constant photon which instantiates a new Photon class.</p><p>Let’s now declare our Quote model. Paste the code below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/874833e0eb59c95e1532995def5b32d9/href">https://medium.com/media/874833e0eb59c95e1532995def5b32d9/href</a></iframe><p>The name parameter should be the same as defined in the schema.prisma file.</p><p>The definition function lets you expose a particular set of fields wherever Quote is referenced. Here, we expose id, content, and author fields.</p><p>Below that, paste the Query constant:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/05a422523fd5aee886613c5bf221f7a8/href">https://medium.com/media/05a422523fd5aee886613c5bf221f7a8/href</a></iframe><p>The Photon generator generates an API that exposes CRUD functions on the Quote model. This is what allows us to expose the t.crud.quotes() method.</p><p>Then we make a field named filterQuotesByAuthor. The return type is Quote. It takes an argument author, which is of type String. This argument is received in the resolve function as the 2nd argument. The 3rd argument is the context ctx.</p><p>We can call context to get the contents from our SQLite database.</p><blockquote><em>Note that the name of the </em><em>quotes property is auto-generated using the </em><a href="https://github.com/blakeembrey/pluralize"><em>pluralize</em></a><em> package. It’s therefore recommended to name our models singular, i.e. </em><em>Quote and not </em><em>Quotes.</em></blockquote><p>We use the findMany method on quotes, which returns a list of objects. We find all the quotes with a partially matched author.</p><p>The contains keyword denotes it&#39;s partially matched. For a complete match, you can replace author: {contains: author} with author: author. The complete match will require the complete name of the author to get the results.</p><p>Below Query, paste Mutation as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/875465a87bec89c46f064d2b3d970401/href">https://medium.com/media/875465a87bec89c46f064d2b3d970401/href</a></iframe><p>The CRUD API here exposes createOneQuote and deleteOneQuote.</p><p>createOneQuote, as the name suggests, creates a quote, whereas deleteOneQuote deletes a quote.createOneQuote is aliased as createQuote, so while calling the mutation, we call createQuote rather than calling createOneQuote.</p><p>Similarly, we call deleteQuote instead of deleteOneQuote.</p><p>Finally, paste the following code below Mutation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/df0f63b82983a869e6336a0d2ecf990f/href">https://medium.com/media/df0f63b82983a869e6336a0d2ecf990f/href</a></iframe><p>We use the makeSchema method from the nexus package to combine our model Quote and add Query and Mutation to the types array. We also add nexusPrismaPlugin to our plugins array. Then we output our schema in the same directory and name it schema.graphql. Finally, we auto-generate types in the node_modules/@generated/photon folder.</p><p>At last, paste the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8aed72653af48170afa1526a8967382a/href">https://medium.com/media/8aed72653af48170afa1526a8967382a/href</a></iframe><p>Finally, we start our server at <a href="http://localhost:4000/">http://localhost:4000/</a>. Port 4000 is the default port for <a href="https://github.com/prisma-labs/graphql-yoga">graphql-yoga</a>. You can change the port as suggested <a href="https://github.com/prisma/prisma2/issues/594#issuecomment-534545903">here</a>.</p><p>Let&#39;s start the server now. But first, we need to make sure our latest schema changes are written to the node_modules/@generated/photon directory. This happens when you run prisma2 generate.</p><p>Migrating your database with Lift follows a 2-step process:</p><ol><li>Save a new migration (migrations are represented as directories on the file system)</li><li>Run the migration (to actually migrate the schema of the underlying database)</li></ol><p>In CLI commands, these steps can be performed as follows (the CLI steps are in the process of being updated to match):</p><pre>$ prisma2 lift save --name &#39;init&#39;<br>$ prisma2 lift up</pre><p>Again you’d have to replace prisma2 with ./node_modules/.bin/prisma2 if you haven&#39;t installed it globally.</p><p>Now the migration process is done. We’ve successfully created the table.</p><p>Generate the database schema by typing the following in the terminal:</p><pre>$ prisma2 generate</pre><p>Now we can seed our database with initial values.</p><p>Go ahead and run the following command in the terminal:</p><pre>$ yarn seed</pre><p>This will seed our database with 4 quotes as specified in our ./quotes.json file.</p><p>Now you can run the server by typing:</p><pre>$ yarn dev</pre><p>This will run your server at <a href="http://localhost:4000/">http://localhost:4000/</a>, with which you can open and query all the APIs you’ve made.</p><h3>Query all quotes</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0571b714f142cd7c56fbfd19228048d3/href">https://medium.com/media/0571b714f142cd7c56fbfd19228048d3/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Wt_pJ0TvX6Ig5ZuZ" /><figcaption>Programming Quotes — Query all quotes</figcaption></figure><p>Filter Quotes by Author</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5d5f3ff5f152c8f4fc3300b40eebf28/href">https://medium.com/media/d5d5f3ff5f152c8f4fc3300b40eebf28/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vpyGiHKwH2IlsZ1i" /><figcaption>Programming Quotes — Filter Quotes by Author</figcaption></figure><h3>Create Quote Mutation</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f4a93ede572bdc427f54726b0499b24/href">https://medium.com/media/9f4a93ede572bdc427f54726b0499b24/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9a63JXwlR8mclVpZ" /><figcaption>Programming Quotes — Create Quote Mutation</figcaption></figure><h3>Delete Quote Mutation</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d1ced95280ef85594a8da14287164437/href">https://medium.com/media/d1ced95280ef85594a8da14287164437/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hka6Ej_zrxVdP6x2" /><figcaption>Programming Quotes — Delete Quote Mutation</figcaption></figure><h3>Docs panel in GraphiQL Editor</h3><p>You can click on the Docs panel in the GraphiQL editor to look closer at the queries and the mutation as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9669AUWmtvY8KaLY" /><figcaption>Programming Quotes — Docs panel in GraphiQL Editor</figcaption></figure><p>This helps us write the queries and the mutations, which in turn makes writing client-side code easy.</p><p>Now that our backend works perfectly, let&#39;s make the frontend.</p><h3>Frontend (Client-Side)</h3><p>Start a new React Native project by using the <a href="https://github.com/npm/npx">npx</a> command as follows:</p><pre>$ npx react-native init ProgrammingQuotes</pre><p>Alternatively, you can install the react-native-cli globally and run the init command then:</p><pre>$ yarn global add react-native-cli // or npm install --global react-native-cli</pre><pre>$ react-native init ProgrammingQuotes</pre><p>This bootstraps a new React Native project using react-native-cli. To run the project, type this:</p><pre>$ yarn start</pre><p>This will run the bundler. We then need to specify on which device we need to run this project. To run it on iOS, type:</p><pre>$ yarn ios</pre><p>To run it on Android, type:</p><pre>$ yarn android</pre><blockquote><em>Note that you must be already running an Android emulator for the above command to work. iOS runs the simulator even if it’s not already running.</em></blockquote><p>It should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6A26vsPBLBtOpUI3" /><figcaption>Programming Quotes — React Native Init</figcaption></figure><pre>$ yarn add @apollo/react-hooks apollo-boost graphql</pre><p>Now replace App.js with the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ac97560a7d32db859ed31d02d341f1d/href">https://medium.com/media/7ac97560a7d32db859ed31d02d341f1d/href</a></iframe><p>Go ahead and create a components folder.</p><pre>$ mkdir components &amp;&amp; cd $_</pre><p>Inside this components folder, create a graphql folder.</p><pre>$ mkdir graphql &amp;&amp; cd $_</pre><p>Inside the graphql folder, create mutations and queries folders.</p><pre>$ mkdir mutations queries</pre><p>Inside the queries folder, create a file named quotes.js.</p><pre>$ cd queries<br>$ touch quotes.js</pre><p>Inside quotes.js, paste the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b30787608ec5b9877200fdd7aed4b121/href">https://medium.com/media/b30787608ec5b9877200fdd7aed4b121/href</a></iframe><p>Notice that the above query is similar to what we typed in the GraphiQL editor. This is how GraphQL is used. First, we type the query in the GraphiQL editor and see if it gives the data that we need, and then we just copy-paste it into the application.</p><p>Inside the mutations folder, create 2 files: createQuote.js and deleteQuote.js.</p><pre>$ cd ../mutations<br>$ touch createQuote.js deleteQuote.js</pre><p>Inside createQuote.js, paste the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a2ad87d1c5e7c1d17ad43e88bd3fcb4/href">https://medium.com/media/7a2ad87d1c5e7c1d17ad43e88bd3fcb4/href</a></iframe><p>Again, we’ve copied the mutation from our GraphiQL editor above. The main difference is we’ve replaced the hardcoded value with a variable so we can type in whatever a user has specified.</p><p>Inside deleteQuote.js, paste the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5b0b81156c5f5b302b8a2ea5d55e6e04/href">https://medium.com/media/5b0b81156c5f5b302b8a2ea5d55e6e04/href</a></iframe><p>Now create 2 files in the components/ folder; namely Error.js and Loading.js .</p><pre>$ cd ../../<br>$ touch Loading.js Error.js</pre><p>In Error.js, paste the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8a105e5b5f29cccee20968de084144d/href">https://medium.com/media/a8a105e5b5f29cccee20968de084144d/href</a></iframe><p>In Loading.js, paste the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c30b1293fdf1292c1c09e08fce0c488e/href">https://medium.com/media/c30b1293fdf1292c1c09e08fce0c488e/href</a></iframe><p>These components will be used later in the application. Let’s now display all the quotes in the application. Firstly, open the App.js file and paste the following code below the Text:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/158b706ef1e712b1841ede71e3e5a258/href">https://medium.com/media/158b706ef1e712b1841ede71e3e5a258/href</a></iframe><p>Also, make sure to import those components:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ff9bde25dbf3a7925e5b410750e7a22/href">https://medium.com/media/4ff9bde25dbf3a7925e5b410750e7a22/href</a></iframe><p>The whole App.js file should now look like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1870b2180816a8e0b54d2c30b82abdd7/href">https://medium.com/media/1870b2180816a8e0b54d2c30b82abdd7/href</a></iframe><p>Make sure to comment out CreateQuote above for now so that we don&#39;t get an error. Create a file in the components/ directory named ListQuotes.js.</p><pre>$ touch ListQuotes.js</pre><p>Now go ahead and paste the following in it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3759c26602b32ac915b8cf5ce2891ea9/href">https://medium.com/media/3759c26602b32ac915b8cf5ce2891ea9/href</a></iframe><p>Here, we use the useQuery API from @apollo/react-hooks. We pass in GET_QUOTES_QUERY to it. And we get back 3 parameters, loading, error, and data.</p><p>We show the &lt;Loading /&gt; component if loading is true.</p><p>We show the &lt;Error /&gt; component if error is true.</p><p>Then, if we don’t have quotes, we display a friendly message No quotes in the database. Add one :).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zRPZuUTax28cxCcE" /><figcaption>Programming Quotes — No Quotes</figcaption></figure><p>If we do have quotes in the database, then we display the quotes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-S2VBe1dUCBVCofG" /><figcaption>Programming Quotes — List Quotes</figcaption></figure><p>We use FlatList to render the quotes.</p><p>Next, let’s implement delete functionality. Go ahead and add the following code just below the useQuery function and above the loading if-statement:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2eb15f6690c3b1ec255768afd4f95f7/href">https://medium.com/media/e2eb15f6690c3b1ec255768afd4f95f7/href</a></iframe><p>We’ll use the deleteQuote function below. Add the following code just below the closing View tag inside the FlatList component:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/397aa991c2d6777c77ee57b6ebca8c2e/href">https://medium.com/media/397aa991c2d6777c77ee57b6ebca8c2e/href</a></iframe><p>The above code just creates a Button, which calls the removeQuote function, which we haven&#39;t created yet.</p><p>Now add the removeQuote function just below the imports:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e7dc56ce66884ded340ecf18b25f2a49/href">https://medium.com/media/e7dc56ce66884ded340ecf18b25f2a49/href</a></iframe><p>This function calls the deleteQuote mutation and optimistically updates the UI to remove deleted results without having to refresh the app.</p><p>The whole ListQuotes.js file should now look like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ead52312d2c874dd6249ed70071ed592/href">https://medium.com/media/ead52312d2c874dd6249ed70071ed592/href</a></iframe><p>Make you haven’t missed anything. Otherwise, it won’t delete the quote properly. Your app should now look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EoQD1eiNMtD44wEj" /><figcaption>List Quotes Complete Screen with Delete Functionality</figcaption></figure><p>You can try deleting a quote now, and it will be deleted. Uncomment CreateQuote in App.js file now. Go ahead and create a new file called CreateQuote.js.</p><pre>$ touch CreateQuote.js</pre><p>Paste the following in it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/58c08d59e1a68e0469e3fd2634e279b1/href">https://medium.com/media/58c08d59e1a68e0469e3fd2634e279b1/href</a></iframe><p>Here, we create 2 inputs, one for quote and one for author. We then use React Hooks to get the data in our 2 variables, quote and author. Finally, when the user taps the Button, we call the saveQuote function.</p><p>The saveQuote function calls the mutation createQuote with the variables content and author. It also uses the update function to append the newly created quote to the UI so you can see the quote without refreshing the app. And finally, it makes the input fields blank after it’s done creating the quote.</p><p>Your app should now look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tUVl172RD6zFueg0" /><figcaption>Programming Quotes — Create Quote</figcaption></figure><h3>Conclusion</h3><p>We have built a complete functional application from scratch with React Native and the Prisma Framework (formerly, Prisma 2).</p><p>The Prisma Framework allows us to write a query in our language of choice, and then it maps everything out to a database so we don’t have to worry about writing it in the database language. We can easily swap out any database by using it. Currently, it’s in <a href="https://isprisma2ready.com/">beta</a>, but you can still use it to create applications at lightning speed.</p><p>You can now create any fully-functional application using React Native and Prisma 2. If you’d like to explore the full code for this project, you can check out this GitHub repo:</p><p><a href="https://github.com/deadcoder0904/ProgrammingQuotes">deadcoder0904/ProgrammingQuotes</a></p><p><em>Editor’s Note: </em><a href="https://heartbeat.comet.ml/"><em>Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We’re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.ml/?utm_campaign=heartbeat-statement&amp;utm_source=blog&amp;utm_medium=medium"><em>Comet</em></a><em>, an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don’t sell ads.</em></p><p><em>If you’d like to contribute, head on over to our</em><a href="https://heartbeat.fritz.ai/call-for-contributors-october-2018-update-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletters (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em> and the </em><a href="https://info.comet.ml/newsletter-signup/"><em>Comet Newsletter</em></a><em>), join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3055ed122b5c" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/getting-started-with-the-prisma-framework-formerly-prisma-2-in-react-native-3055ed122b5c">Getting Started with the Prisma Framework (formerly Prisma 2) in React Native</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling responsive layouts in React Native apps]]></title>
            <link>https://heartbeat.comet.ml/handling-responsive-layouts-in-react-native-apps-1494b3f85984?source=rss-784e5fbd9c36------2</link>
            <guid isPermaLink="false">https://medium.com/p/1494b3f85984</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[heartbeat]]></category>
            <category><![CDATA[layout]]></category>
            <dc:creator><![CDATA[Akshay Kadam]]></dc:creator>
            <pubDate>Thu, 29 Aug 2019 15:57:33 GMT</pubDate>
            <atom:updated>2021-09-22T14:41:41.360Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NChKVCdfrVrfyqa2oogK5A.png" /></figure><blockquote>React Native makes it easy to write code once and run your apps on both Android and iOS at the same time. But a problem arises when trying to make the app responsive. Unlike CSS, there is no such thing as media queries in React Native. To make the app look good on phone, tablets, and a variety of other devices, we need to scale all of our styles.</blockquote><h3>Prerequisites</h3><p>For this tutorial, you need a basic knowledge of <a href="https://facebook.github.io/react-native/">React Native</a> and some familiarity with <a href="https://expo.io/">Expo</a>. You’ll also need the Expo client installed on your mobile device or a compatible simulator installed on your computer Instructions on how to do this can be found <a href="https://docs.expo.io/versions/latest/introduction/installation/">here</a>.</p><p>Throughout this tutorial, we’ll be using yarn. If you don&#39;t have yarn already installed, then install it <a href="https://docs.expo.io/versions/latest/introduction/installation/">here</a>.</p><p>Also, make sure you’ve already installed expo-cli.</p><p>If it’s not installed already, then go ahead and install it:</p><pre>$ yarn global add expo-cli</pre><p>To make sure we’re on the same page, the following are the versions used in this tutorial -</p><ul><li>Node v12.6.0</li><li>yarn 1.17.3</li><li>expo 3.0.9</li></ul><p>Make sure to update expo-cli if you haven&#39;t updated it in a while, since expo releases are quickly out of date.</p><p>To create a new project using expo-cli, type the following in the terminal:</p><pre>$ expo init responsive-react-native-layout</pre><p>It will then prompt you to choose a template. You should choose blank and hit Enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4-OM45JGH2B_sva4NzdWrw.png" /><figcaption>1. Expo Init — Choose A Template</figcaption></figure><p>Then it will ask you to name the project—type responsive-react-native-layout and hit Enter again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-GALD3QmR7KaS3nMgI1cgQ.png" /><figcaption>2. Expo Init — Name the Project</figcaption></figure><p>Lastly, it will ask you to press Y to install dependencies with yarn or n to install dependencies with npm. Press y.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ribqfaT7ztJ0z1b24onPHw.png" /><figcaption>3. Expo Init — Install the dependencies</figcaption></figure><p>This will create a folder called responsive-react-native-layout, which will bootstrap a new Expo project.</p><p>Now go ahead and change the directory to responsive-react-native-layout using the following command:</p><pre>$ cd responsive-react-native-layout</pre><p>Type the following to start running the app:</p><pre>$ yarn start</pre><p>Press i to run the iOS Simulator. This will automatically run the iOS Simulator even if it&#39;s not opened.</p><p>Press a to run the Android Emulator. Note that the emulator must be installed and started already before typing a. Otherwise, it will throw an error in the terminal.</p><h3>Problem with responsive layout in React Native</h3><p>When you make a React Native app, you make it work with a device of one dimension. As such, when you open the same app in another device of another dimension, it looks distorted. What happens in these cases, is those different devices have different pixel ratios.</p><p>React Native accepts either percentages or density-independent pixels (DP) for its styles. Percentages work well on the web, but they don’t support all the style properties in React Native. Only padding, margin, width, height, minWidth, minHeight, maxWidth, maxHeight, flexBasis can have percentage values according to <a href="https://github.com/facebook/react-native/commit/3f49e743bea730907066677c7cbfbb1260677d11">this commit</a>.</p><p>Density independent pixels (DP) are different than traditional pixels. The bigger the device, the more DP it has. However, density-independent pixels (DP) vary from device to device, so it cannot be directly used for creating a responsive layout.</p><h3>Solution using react-native-responsive-screen</h3><p><a href="https://github.com/marudy/react-native-responsive-screen">react-native-responsive-screen</a> is a package that makes constructing a responsive layout very easy.</p><p>The whole code for the package is as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/923d26fa01c289cc80be67cc2b6f7144/href">https://medium.com/media/923d26fa01c289cc80be67cc2b6f7144/href</a></iframe><p>The two most important functions we need for making a responsive layout are widthPercentageToDP and heightPercentageToDP.</p><p>widthPercentageToDP takes in a percentage of a screen&#39;s width that a UI element should cover and returns a calculated, DP depending on the current device&#39;s screen width.</p><p>Similarly, heightPercentageToDP takes in a percentage of a screen&#39;s height that a UI element should cover and returns a calculated DP, depending on the current device&#39;s screen height.</p><p>Consider an example where the device has a width of 480 DP. If we do</p><pre>&lt;View style={{width: widthPercentageToDP(&#39;80%&#39;)}} /&gt;</pre><p>then it will be translated to</p><pre>&lt;View style={{width: 384 }} /&gt;</pre><p>because 80% of 480 = (80/100) * 480 = 384 DP</p><p>Consider another example: If a device has a width of 390 DP</p><pre>&lt;View style={{width: widthPercentageToDP(&#39;80%&#39;)}} /&gt;</pre><p>then it will be translated to</p><pre>&lt;View style={{width: 312 }} /&gt;</pre><p>because 80% of 390 = (80/100) * 390 = 312 DP.</p><p>So no matter what the device width is, the above View will translate it to 80% of its device’s width. Similarly, if you use heightPercentageToDP instead of widthPercentageToDP, then it will translate accordingly to the device&#39;s height. This way, UI elements scale up and down depending on device resolutions.</p><h3>Implementation</h3><p>To show how this works in practice, we’re going to build a chat app that looks like this:</p><h4>On a Phone (iPhone X)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*rqpIJw6zcUWo1bCSwooLjg.png" /><figcaption>Chat App on iPhone X</figcaption></figure><h4>On a Tablet (iPad Air 2)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fFxUnglKeewVSl5msbNExA.png" /><figcaption>Chat App On iPad Air 2</figcaption></figure><p>Let’s go ahead and install react-native-responsive-screen first. Open up your terminal and type:</p><pre>$ yarn add react-native-responsive-screen</pre><p>Also, download <a href="https://github.com/deadcoder0904/responsive-react-native-layout/blob/master/assets/pikachu_heart_eyes.png">pikachu_heart_eyes.png</a> and paste it into assets/ folder.</p><p>Now open App.js and add the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f55c5fcce2c29421e1e9e215085886fb/href">https://medium.com/media/f55c5fcce2c29421e1e9e215085886fb/href</a></iframe><p>Here, we have SafeAreaView, which renders content within the safe area boundaries of a device. Inside that, we have ScrollView, which allows us to scroll content if it’s beyond the boundaries of a device. And then we’ve added an Image tag showing a Pikachu image.</p><p>We’ve also imported heightPercentageToDP and widthPercentageToDP and aliased them as hp and wp respectively.</p><p>Then we’ve used them in the StyleSheet as width: wp(&#39;70%&#39;) and height: hp(&#39;30%&#39;). This means that the Pikachu image will always be 70% of the device&#39;s width and 30% of the device&#39;s height.</p><p>Now, let’s add the chats to our app.</p><p>Go ahead and put the following dummy chats above the default export App:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/27be472742ded0e56b46a76508ed4972/href">https://medium.com/media/27be472742ded0e56b46a76508ed4972/href</a></iframe><p>Now paste the following below the Image tag:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9aaa1e4d5cae9dbcd3fdfe3f4a8dc082/href">https://medium.com/media/9aaa1e4d5cae9dbcd3fdfe3f4a8dc082/href</a></iframe><p>Here, we loop over the chats and style the chats appropriately.</p><p>Also, add the styles in the StyleSheet below img:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4dfe7f30dfe8e74a2b0d4aab1cc77471/href">https://medium.com/media/4dfe7f30dfe8e74a2b0d4aab1cc77471/href</a></iframe><p>The only thing regarding react-native-responsive-screen is the fontSize property in commonChat styles. The font size is 1.6% of the device’s height.</p><p>The padding, margin, borderRadius, and borderWidth are simple density-independent pixels (DP). However, they can also be added as a variant of hp and wp.</p><p>hp and wp can be used for any style property that accepts DP as a value. DP values are the ones of type number over the props mentioned in RN docs: <a href="https://facebook.github.io/react-native/docs/view-style-props.html">View style props</a>, <a href="https://facebook.github.io/react-native/docs/text-style-props.html">Text style props</a>, <a href="https://facebook.github.io/react-native/docs/image-style-props.html">Image style props</a>, <a href="https://facebook.github.io/react-native/docs/layout-props.html">Layout props</a>, and <a href="https://facebook.github.io/react-native/docs/shadow-props.html">Shadow props</a>.</p><p>Finally, the App.js file should look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d2128227d851f676a27ec754ba0d120/href">https://medium.com/media/6d2128227d851f676a27ec754ba0d120/href</a></iframe><p>Now go ahead and open your app on different devices to see how it scales up and down depending on the device size. Notice how the Pikachu image remains 70% wide and 30% high. The font size of the chat should also remain 1.6% of the height of the device.</p><p>A best practice is to start developing the layout from bigger devices like tablets and then work your way down to smaller devices like phones. This way, it becomes easy to make UI elements responsive quickly. The only properties that need to be changed to make them responsive are the ones with type number.</p><p>Complete code for this tutorial can be found over at <a href="https://github.com/deadcoder0904/responsive-react-native-layout">GitHub</a>:</p><p><a href="https://github.com/deadcoder0904/responsive-react-native-layout">deadcoder0904/responsive-react-native-layout</a></p><h3>Conclusion</h3><p>In this tutorial, we learned about the problems encountered with responsive layouts and how to solve them. Then, we learned about the package react-native-responsive-screen, which makes building responsive layouts easy.</p><p>We finally used the exposed methods from react-native-responsive-screen for all of the type number properties used in our app to make our app fully responsive to all screen sizes.</p><p>Now making responsive layouts should be a piece of cake.</p><p><em>Editor’s Note:</em><a href="http://heartbeat.fritz.ai/"><em> Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We’re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.ml/?utm_campaign=heartbeat-statement&amp;utm_source=blog&amp;utm_medium=medium"><em>Comet</em></a><em>, an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don’t sell ads.</em></p><p><em>If you’d like to contribute, head on over to our</em><a href="https://heartbeat.fritz.ai/call-for-contributors-october-2018-update-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletters (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em> and the </em><a href="https://info.comet.ml/newsletter-signup/"><em>Comet Newsletter</em></a><em>), join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1494b3f85984" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/handling-responsive-layouts-in-react-native-apps-1494b3f85984">Handling responsive layouts in React Native apps</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloning Dark Mode List using React Native and AWS AppSync]]></title>
            <link>https://medium.com/react-native-training/cloning-dark-mode-list-using-react-native-and-aws-appsync-1c0f7ff0d81e?source=rss-784e5fbd9c36------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c0f7ff0d81e</guid>
            <category><![CDATA[aws-appsync]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[apollo]]></category>
            <dc:creator><![CDATA[Akshay Kadam]]></dc:creator>
            <pubDate>Thu, 28 Jun 2018 21:29:47 GMT</pubDate>
            <atom:updated>2018-07-03T06:08:32.293Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Learn how to build Dark Mode List App using React Native &amp; AWS AppSync</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xFEeNvoxv6gW4bcYTBBASQ.png" /><figcaption>Checkout <a href="https://darkmodelist.com/">https://darkmodelist.com</a> by <a href="https://twitter.com/AndreyAzimov">Andrey Azimov</a></figcaption></figure><h3>Introduction</h3><p>We’re going to create a simple clone of <a href="https://darkmodelist.com/">DarkModeList</a> by <a href="https://medium.com/@AndreyAzimov">Andrey Azimov</a>. It is a website which lists all the websites &amp; apps that have a Dark Theme.</p><h3>Backend</h3><p>Firstly, we will make our Backend work properly with AWS AppSync &amp; store all the data in DynamoDB. Then, we will dive into the Frontend part with React Native.</p><h3>What is AWS AppSync?</h3><blockquote><a href="https://aws.amazon.com/appsync/"><strong>AWS AppSync</strong></a>, launched at the re:Invent 2017, is a new AWS service which lets you use GraphQL in the cloud &amp; offers you data updates in web &amp; mobile applications in realtime.</blockquote><p>It also has built-in offline support so your users can use the application offline &amp; updates will be sent to the server as soon as they reconnect.</p><p>It has built-in integration with <strong>DynamoDB</strong>, <strong>AWS Lambda</strong> &amp; <strong>ElasticSearch</strong>. It also has SDKs for Web, Android, iOS &amp; React Native.</p><h3>Getting Started</h3><p>Now go ahead <strong>Sign Up</strong> for an AWS Account if you don’t have one already &amp; then log in to the <strong>AWS Console</strong>.</p><p>Now click on <strong>Services</strong> &amp; then under <strong>Mobile Services</strong> section, select <strong>AWS AppSync</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*panJky9hf45eIzIY_AQAog.png" /><figcaption>Figure 1: AWS Console</figcaption></figure><p>Once you are in the <strong>AppSync Console</strong> click on <strong>Create API</strong>. I have 3 sample apps so your console will look different if its your first time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3HRLZwD3IHaY56Ud6phUKA.png" /><figcaption>Figure 2: AWS AppSync APIs Console</figcaption></figure><p>Go ahead &amp; enter <strong>DarkModeList</strong> &amp; choose <strong>Custom Schema</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h70TuPgr-hocdrjfsrENQA.png" /><figcaption>Figure 3: Create New API Console</figcaption></figure><p>Here, we have a menu on the left of us that allows us to explore &amp; edit the <strong>Schema</strong> as well as we can test our <strong>Queries</strong>. We can also manage our <strong>Data Sources</strong> related to the API here &amp; manage <strong>Settings</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGpctr8v5hK5jkF5veDpmA.png" /><figcaption>Figure 4: API URL &amp; Auth Mode</figcaption></figure><p>Here, we see our API endpoint URL &amp; auth mode which by default is <strong>API_KEY</strong></p><p>We also have a Getting Started Guide for quickly getting up &amp; running our frontend. But we won&#39;t require it as we will be using our own Custom Frontend. So scroll to the bottom &amp; click on the <strong>Download</strong> below. Keep the <strong>AppSync.js</strong> file as we will require it later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khaVjsuSNTczYM8aLwzBwA.png" /><figcaption>Figure 5: Download <strong>AppSync.js</strong> for <strong>React Native</strong></figcaption></figure><h3>Creating the Schema</h3><p>Now select <strong>Schema</strong> in the Sidebar, clear out the commented code &amp; paste the following -</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2cc96436d436492fd9004acd9eca72c6/href">https://medium.com/media/2cc96436d436492fd9004acd9eca72c6/href</a></iframe><p>Now go ahead &amp; click on <strong>Save</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZ0AVB6zQ05CUPE-k4I12Q.png" /><figcaption>Figure 6: Save Schema</figcaption></figure><h3>Creating the Resources</h3><p>We have successfully created the <strong>Schema</strong>. Now go ahead &amp; click on <strong>Create Resources</strong> (Figure 7)</p><p>This will create resolvers to map the GraphQL request and response between the database and the schema. AppSync will automatically generate this for us.</p><p>Select <strong>App</strong> as the type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*araD9bbLmgXkb_SRvIWeyg.png" /><figcaption>Figure 7: Create Resources</figcaption></figure><p>Here, you can change the Table name as well as change the Primary Key or Sort Key. You can also see that AppSync autogenerated the Schema for us which lets us perform all the <a href="https://www.codecademy.com/articles/what-is-crud">CRUD</a> operations.</p><p>Now go ahead &amp; click on <strong>Create</strong> at the bottom.</p><p>This will create <strong>DynamoDB</strong> Tables for us &amp; resolvers were created to map between the schema &amp; the table. Also, our schema has been changed. Our new schema will look like -</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b504912bcae7a38ce80e3c4c93258fc4/href">https://medium.com/media/b504912bcae7a38ce80e3c4c93258fc4/href</a></iframe><p>Go ahead &amp; click on <strong>Data Sources</strong> in the Sidebar to see our newly created Table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eqQVO-aRH0A8hI7xIV-tsw.png" /><figcaption><a href="https://gist.github.com/59bef98f90c95af84f9a83b9095863c7">F</a>igure 8: Data Sources</figcaption></figure><h3>Queries</h3><p>Now select <strong>Queries</strong> &amp; clear out the commented code &amp; run the following Mutation -</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/511c6c89deba17cfd7de319cd110371d/href">https://medium.com/media/511c6c89deba17cfd7de319cd110371d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kPfWEwdR9ZLeImOsO_WBQg.png" /><figcaption>Figure 9: Mutation Create App</figcaption></figure><p>You should be able to see the id, name &amp; link get back on the right hand side.</p><p>Now let us list all apps by sending a Query. Paste the following query to fetch all apps -</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/20652ed394489bfdd28f67912e80ae00/href">https://medium.com/media/20652ed394489bfdd28f67912e80ae00/href</a></iframe><p>You should see the following on the right hand side -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BQ4j1LlnoM061Q2nIV5CDA.png" /><figcaption>Figure 10: Queries List App</figcaption></figure><h3>Data Sources</h3><p>Now select <strong>Data Sources</strong> &amp; click on <strong>AppTable</strong> under the <strong>Resource</strong> column. It will open a New Tab showing our Dynamo DB Tables. Select <strong>Items</strong> column to see our <strong>WIP Chat</strong> mutation in the DynamoDB table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w3UnZCQa0vDfaxavCVXN3A.png" /><figcaption>Figure 11: Dynamo DB Table</figcaption></figure><p>Now that we have our AppSync Backend working properly, lets dive into the FrontEnd.</p><h3>Frontend</h3><p>Now, I will be assuming you are at least familiar with basics of React or React Native. We will start with a simple boilerplate which uses <a href="https://github.com/react-native-training/react-native-elements">React Native Elements</a> UI Kit so we don’t have to worry much about styling.</p><p>Boilerplate code has 2 simple inputs for <strong>App Name</strong> &amp; <strong>App URL</strong> &amp; 1 <strong>Submit</strong> Button. Below that it displays the list of Apps that you have entered.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/31fe3997be90377126d27d0e258095b2/href">https://medium.com/media/31fe3997be90377126d27d0e258095b2/href</a></iframe><p>Clone the boilerplate project from <a href="https://github.com/deadcoder0904/react-native-darkmode-list/tree/boilerplate">here</a> &amp; install the dependencies with yarn or npm install to get started.</p><p>Once you run the app, it should look like -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*laBTxsySoCMj7EyOsCqb4Q.png" /><figcaption>Figure 12: Dark Mode List App Showcase</figcaption></figure><p>Now lets create it to use our AppSync API. Make sure you have <strong>AppSync.js</strong> file in your root folder which can be downloaded from the AppSync console as mentioned in the Backend Part.</p><p>We will be using the Apollo as our GraphQL Client which is a pleasure to work with &amp; has a very simple &amp; straight-forward API.</p><p>Go ahead &amp; install the following dependencies -</p><p>yarn add aws-appsync aws-appsync-react react-apollo graphql-tag uuid</p><p>or if you use npm type</p><p>npm install aws-appsync aws-appsync-react react-apollo graphql-tag uuid</p><p>Now put the code given below at the top of the file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/939abe0a5d6d5e55e40c944124b17676/href">https://medium.com/media/939abe0a5d6d5e55e40c944124b17676/href</a></iframe><p>Here, 3 things are happening -</p><ol><li>We are creating a new AppSync client and storing it in the client variable. We are also passing it different parameters like url which links to our GraphQL Endpoint, region which specifies which Region our Endpoint is at &amp; finally auth object. The auth object contains type property, which by default is API_KEY, but for more security you should either choose IAM (including short-term credentials from Amazon Cognito Federated Identities), or Amazon Cognito user pools.</li><li>Here we are using the ApolloProvider from react-apollo to pass the client that we created above into our application. This gives us access to our AppSync client anywhere in our entire app. Rehydrated waits until the application cache is ready to use in the app before rendering the app itself. By default, it shows loading text but can be easily configured.</li><li>Change our default export from App to WithProvider</li></ol><p>Now go ahead &amp; paste the mutation to create new app. Also, paste the query to list our apps. This is the same mutation &amp; the same query that we ran in the backend part</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5bcd897784aeee3f4bc9216765c15904/href">https://medium.com/media/5bcd897784aeee3f4bc9216765c15904/href</a></iframe><p>Now import these 2 files on the top of <strong>App.js</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ffcad17cbd63d1953ff7b3227246f15/href">https://medium.com/media/0ffcad17cbd63d1953ff7b3227246f15/href</a></iframe><p>Then change the code to render our list of apps as follows -</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/533149cf427b2c93e2a60c48e894d42d/href">https://medium.com/media/533149cf427b2c93e2a60c48e894d42d/href</a></iframe><p>Now go ahead &amp; replace the following block of code in render function</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cce2cf61cce5b591426d693b1a9110c8/href">https://medium.com/media/cce2cf61cce5b591426d693b1a9110c8/href</a></iframe><p>with the next block of code</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9bbc4964b522fb288d004070bfbccdbf/href">https://medium.com/media/9bbc4964b522fb288d004070bfbccdbf/href</a></iframe><p>There are 4 things happening here -</p><ol><li>First we have our &lt;Loading /&gt; component that shows a large spinner</li><li>Then we have our &lt;Error /&gt; component which shows error message in red</li><li>Next is our &lt;ListItem /&gt; function which is from the react-native-elements UI Kit</li><li>Finally, we have &lt;Query /&gt; component which shows list of our apps. It uses the Render Prop API which makes it simple to understand. Remove the earlier code which lists the apps &amp; place this chunk of code inplace of it.</li></ol><p>This should properly fetch &amp; render the list of apps that are present in our database DynamoDB.</p><p>Now let’s go ahead &amp; add &lt;Mutation /&gt; component to create new app.</p><p>Again replace the following in render function</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4d984f80fda8f427a599b6ff633748e2/href">https://medium.com/media/4d984f80fda8f427a599b6ff633748e2/href</a></iframe><p>with the next block of code</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5cb4cb567398c739d788d9e1f7ad6c4f/href">https://medium.com/media/5cb4cb567398c739d788d9e1f7ad6c4f/href</a></iframe><p>Here, 3 things are happening -</p><ol><li>Firstly, we are using createApp function which we get from the &lt;Mutation /&gt; component. This allows us to send all input variables to our mutation.</li><li>Next, we use Optimistic Response which shows our users the updated UI without making a trip to the server</li><li>We update our local cache with the new app</li></ol><h3>Conclusion</h3><p>AWS AppSync opens up a lot of possibilities. You can create real-time apps like Chat Messengers, Social Media Apps or even Dating Apps.</p><p>The AWS AppSync Console can be difficult to use &amp; if you our tired of updating or deleting the schema then have a look at <a href="https://github.com/sid88in/serverless-appsync-plugin">serverless-appsync-plugin</a> created by <a href="https://medium.com/@sid88in">Siddharth Gupta</a>.</p><p>You can find the full-source code of Dark Mode List App <a href="https://github.com/deadcoder0904/react-native-darkmode-list">here</a>.</p><blockquote>If you have any questions or just want to say Hi, then feel free to hit me up on <a href="https://gist.github.com/@deadcoder0904">Twitter</a>!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c0f7ff0d81e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/react-native-training/cloning-dark-mode-list-using-react-native-and-aws-appsync-1c0f7ff0d81e">Cloning Dark Mode List using React Native and AWS AppSync</a> was originally published in <a href="https://medium.com/react-native-training">React Native Training</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scaling React Native apps for Tablets]]></title>
            <link>https://medium.com/react-native-training/scaling-react-native-apps-for-tablets-211de8399cf1?source=rss-784e5fbd9c36------2</link>
            <guid isPermaLink="false">https://medium.com/p/211de8399cf1</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Akshay Kadam]]></dc:creator>
            <pubDate>Tue, 01 May 2018 13:14:46 GMT</pubDate>
            <atom:updated>2018-05-01T13:14:46.982Z</atom:updated>
            <content:encoded><![CDATA[<h4>Lets make your React Native app look good on Tablets</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YiTvenEAHsmUnsQo4AB1w.png" /></figure><blockquote>If you’ve ever worked on a React Native app then you must’ve wondered how do I make this look good on Tablets. Worry not. This tutorial will teach you how to make your React Native app not look weird on Tablets or lets say any other device.</blockquote><h3>The Problem</h3><p>When you make a React Native app, you just make it to work on Mobile Phones. The problem occurs when you try to make it work on Tablets. The reason is Tablets have more pixels than Mobile phones. So whatever dimensions you specify for Mobile are definitely not going to work for Tablets. In short, the bigger your device gets, the more pixels it will have.</p><p>From the <a href="https://facebook.github.io/react-native/docs/height-and-width.html">docs</a>,</p><blockquote><em>All dimensions in React Native are unitless, and represent density-independent pixels. Setting dimensions this way is common for components that should always render at exactly the same size, regardless of screen dimensions.</em></blockquote><h3>The Solution</h3><p>I created a simple <strong>Chat App</strong> for this tutorial which already looks good on <strong>Mobile</strong> &amp; we will learn how to scale the app to make it look good on <strong>Tablets</strong>.</p><p>🔗 The complete source code can be found <a href="https://github.com/deadcoder0904/react-native-tablets">here</a>.</p><p>Following picture shows how the App looks when you see it on <strong>Mobile</strong> (<strong>iPhone X</strong>) &amp; when you see it on <strong>Tablet</strong> (<strong>iPad Air 2</strong>) —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SpSRXKDhvFy2GHJy9GRYKg.png" /><figcaption>iPhone X (on the left) &amp; iPad Air 2 (on the right) without Scaling</figcaption></figure><p>As seen above, the app on Tablet looks very small than on Phone. So we need to scale it to look good on Tablet as well.</p><h3>Scaling with Flex</h3><p>Flexbox is helpful while scaling. But, flexbox only scales throughout the entire width or height of the container it is in. It keeps the same proportions among different devices.</p><p>Flexbox can scale well if we add some hacks by introducing more containers but its a lot of work.</p><p>Also, flex is limited to certain properties like width, height, margin &amp; padding. But we can&#39;t use it for some other properties like fontSize, lineHeight or SVGs.</p><h3>Scaling with Percentages</h3><p>We can scale our app well using Percentages (%).</p><p>React Native v0.42 &amp; above has added support for Percentages (%) but it is only limited to the properties like padding, margin, width, height, minWidth, minHeight, maxWidth, maxHeight, flexBasis.</p><p>Other properties like fontSize &amp; lineHeight don&#39;t work well with percentages.</p><h3>Scaling with a Library</h3><p><a href="https://github.com/nirsky/react-native-size-matters"><strong>React Native Size Matters</strong></a> is a library written by <strong>Nir Hadasi</strong> which helps us make our scaling easier by providing 3 simple utility functions.</p><p>The library is very small &amp; it contains 3 simple utility functions namely —</p><blockquote><strong>scale(size: number)</strong> — Returns linear scaled result of the provided size, based on your device&#39;s screen width.</blockquote><blockquote><strong>verticalScale(size: number)</strong> — Returns linear scaled result of the provided size, based on your device&#39;s screen height.</blockquote><blockquote><strong>moderateScale(size: number, factor?: number)</strong> — Returns non-linear scale based on a resize factor (defaults to 0.5). If normal <strong>scale</strong> will increase by +2X, <strong>moderateScale</strong> will only increase it by +X.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GA8_WrZ8iFk47UbAYueAGA.png" /></figure><p>It has some Guideline sizes which are based on ~5&quot; screen mobile devices that makes it easy to scale for bigger devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BwzUJspqV3jjCj1iwrLpFQ.png" /></figure><p>It also has a ScaledSheet method which is a scaled StyleSheet</p><p>It uses the following API —</p><blockquote><strong>&lt;size&gt;@s</strong> — Applies <strong>scale</strong> function on <strong>size</strong></blockquote><blockquote><strong>&lt;size&gt;@vs</strong>— Applies <strong>verticalScale</strong> function on <strong>size</strong></blockquote><blockquote><strong>&lt;size&gt;@ms</strong> — Applies <strong>moderateScale</strong> function with resize factor of 0.5 on <strong>size</strong></blockquote><blockquote><strong>&lt;size&gt;@ms&lt;factor&gt;</strong> — Applies <strong>moderateScale</strong> function with resize factor of factor on <strong>size</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*puP-H-aVJoBgWn7b66cdpA.png" /></figure><h3>Chat App Demo</h3><p>Now we’re going to use react-native-size-matters in our Basic Chat App.</p><p>We’re going to build a simple Chat Wrapper (the one with Yellow &amp; Blue Background) using react-native-size-matters.</p><h4>Without using react-native-size-matters —</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CzHjEpowwNuRP-umMBBuSQ.png" /><figcaption>Without <strong><em>react-native-size-matters</em></strong></figcaption></figure><h4>Using react-native-size-matters —</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QrOhymH0D9QA0FdqCzhqEg.png" /><figcaption>With <strong>react-native-size-matters</strong></figcaption></figure><p>As you can see the only thing we needed to change was height, padding, margin &amp; fontSize to scale it well across different devices.</p><h3>Conclusion</h3><p>The way I like to scale is always try Flexbox in the beginning. Then I try to use Percentages wherever possible. Later, I try to scale the height property vertically using &lt;size&gt;@vs &amp; for everything else I use either &lt;size&gt;@ms or &lt;size&gt;@s.</p><p>The example provided in the repo is a little different as I’ve abstracted the common part into a wrapper to make the code more readable. It also has a switch to check how the App would look if react-native-size-matters is not enabled.</p><p>The final solution after applying scaling looks like —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XtcY3OTKAnOeRiVUWKZmAg.png" /><figcaption>iPhone X (on the left) &amp; iPad Air 2 (on the right) with Scaling</figcaption></figure><p>You can scan the following QR code to run this app if you have the expo.io client installed on your Android or iOS device:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*HjqTLLv1L9J4gSpeXhpnBg.png" /><figcaption><a href="http://expo.io/@deadcoder0904/react-native-tablets">http://expo.io/@deadcoder0904/react-native-tablets</a></figcaption></figure><blockquote>Have more questions about scaling React Native apps?</blockquote><blockquote>Hit me up on <a href="https://twitter.com/@deadcoder0904">Twitter</a>! Don’t be shy to Say Hi 😃</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=211de8399cf1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/react-native-training/scaling-react-native-apps-for-tablets-211de8399cf1">Scaling React Native apps for Tablets</a> was originally published in <a href="https://medium.com/react-native-training">React Native Training</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Download Almost Anything without Torrents]]></title>
            <link>https://medium.com/@deadcoder0904/download-almost-anything-without-torrents-2e0ea92133f?source=rss-784e5fbd9c36------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e0ea92133f</guid>
            <category><![CDATA[movies]]></category>
            <category><![CDATA[piracy]]></category>
            <category><![CDATA[entertainment]]></category>
            <category><![CDATA[torrent]]></category>
            <category><![CDATA[tv-series]]></category>
            <dc:creator><![CDATA[Akshay Kadam]]></dc:creator>
            <pubDate>Wed, 03 Jan 2018 10:01:48 GMT</pubDate>
            <atom:updated>2018-01-03T18:08:39.846Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qk_sAtix1dZfLhWl70WJXw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/23LET4Hxj_U?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jake Hills</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Now for the past few days I’ve been downloading mostly TV series or some PDFs using <a href="https://medium.com/@deadcoder0904/google-hacking-database-4eda32dc2a6a">Google Hacking Database</a> &amp; the trick I am going to show you below 😃</p><p>I will give you my own example. I wanted to watch the TV series <a href="http://www.imdb.com/title/tt4396862/">THE CATCH</a> given .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*LbNMSmRbbDLXB0YII_DeVw.jpeg" /><figcaption><a href="http://www.imdb.com/title/tt4396862/">http://www.imdb.com/title/tt4396862/</a></figcaption></figure><p>But there were 0 seeders on mostly all torrent sites that I know of. So I Googled &amp; found a Quora answer for How to download Series without any seeds.</p><p>Then in 1 answer it said try this on Google -</p><blockquote>index + &lt;thing-you-want-to-download&gt;</blockquote><p>So I did try -</p><blockquote>index + the catch</blockquote><p>And I found <strong>Season 1</strong> in the 1st link itself but Google wasn’t showing <strong>Season 2</strong> results on the 1st Page itself.</p><p>So I tried -</p><blockquote>index + the catch s02</blockquote><p>&amp; then I found the results.</p><p>For some other series though I had to use Google Hacking Database’s <strong><em>filetype </em></strong><em>like -</em></p><blockquote>index + the walking dead s06e07 filetype:mkv</blockquote><p>I guess now you won’t need torrents for downloading something like Movies or Series as some people put it on Cloud. Thanks to this Geniuses we can watch all of it for free. This must be illegal though &amp; you must be using Netflix but what the hell. Enjoy &amp; Have a Happy New Year.</p><h3>Edit:</h3><p>Through a Reddit <a href="https://www.reddit.com/r/Piracy/comments/7ntun6/download_almost_anything_without_torrents/">comment</a> I found a <a href="https://lumpysoft.com/">dedicated website</a> 😍 that does the same thing. Also <a href="https://www.reddit.com/r/opendirectories/">/r/opendirectories</a> has tons of awesome downloadable content.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e0ea92133f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ESLint setup in React Native using VSCode]]></title>
            <link>https://medium.com/@deadcoder0904/eslint-setup-in-react-native-using-vscode-c3122a1da9c7?source=rss-784e5fbd9c36------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3122a1da9c7</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[eslint]]></category>
            <dc:creator><![CDATA[Akshay Kadam]]></dc:creator>
            <pubDate>Thu, 12 Oct 2017 13:18:56 GMT</pubDate>
            <atom:updated>2017-10-14T09:52:25.021Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uOlxCoXq1faNmKA-3ie2Bg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/geNNFqfvw48?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Michał Parzuchowski</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Step 1 : Install `eslint` &amp; `babel-eslint`</h3><blockquote>yarn add eslint babel-eslint -D</blockquote><h3>Step 2 : Start setup</h3><blockquote>./node_modules/.bin/eslint — init</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k0pie8W7cZzSjdcquqCm-g.png" /><figcaption>I’m using Airbnb use whichever you prefer</figcaption></figure><h3>Step 3 : Add the following to `.eslintrc.json`</h3><pre>{<br>  &quot;extends&quot;: &quot;airbnb&quot;,<br>  &quot;parser&quot;: &quot;babel-eslint&quot;,<br>  &quot;env&quot;: {<br>    &quot;browser&quot;: true<br>  },<br>  &quot;plugins&quot;: [&quot;react&quot;],<br>  &quot;rules&quot;: {<br>    &quot;react/jsx-filename-extension&quot;: [<br>      2,<br>      {<br>        &quot;extensions&quot;: [&quot;.js&quot;, &quot;.jsx&quot;]<br>      }<br>    ],<br>    &quot;react/forbid-prop-types&quot;: [0],<br>    &quot;react/require-default-props&quot;: [0],<br>    &quot;global-require&quot;: [0],<br>    &quot;no-underscore-dangle&quot;: [0]<br>  }<br>}</pre><h3>Step 4 : Add the following to `package.json`</h3><pre>&quot;scripts&quot;: {<br>  &quot;lint&quot;: &quot;eslint app/&quot;,<br>  &quot;lint:fix&quot;: &quot;eslint app/ --fix&quot;<br>}</pre><h3>Step 5 : Add this to `.vscode/settings.json`</h3><pre>{<br>  &quot;prettier.eslintIntegration&quot;: true,<br>  &quot;editor.formatOnSave&quot;: true,<br>  &quot;files.exclude&quot;: {<br>    &quot;**/*.git&quot;: true,<br>    &quot;**/*.expo&quot;: true,<br>    &quot;.*&quot;: true,<br>    &quot;**/*.DS_Store&quot;: true,<br>    &quot;node_modules/&quot;: true<br>  }<br>}</pre><p>This is my setup, without any distraction of any dot files. Feel free to change it according to your needs. Now restart VSCode to see Lint errors. Install the popular ESlint package from VSCode.</p><blockquote>Pro tip : Use Prettier with ESlint to get more productive 😉</blockquote><p>TL;DR</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/865b535f4e0a8fadb765c0ed3a8947dd/href">https://medium.com/media/865b535f4e0a8fadb765c0ed3a8947dd/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3122a1da9c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginning of DS & AOA Journey]]></title>
            <link>https://medium.com/@deadcoder0904/beginning-of-ds-aoa-journey-4c4528b4519b?source=rss-784e5fbd9c36------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c4528b4519b</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Akshay Kadam]]></dc:creator>
            <pubDate>Mon, 20 Mar 2017 15:15:43 GMT</pubDate>
            <atom:updated>2017-03-20T15:16:10.708Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve learnt Data Structures &amp; Analysis of Algorithms a long time ago (atleast 2 years ago) but that was done just bcz I had it in my University Syllabus &amp; I thought DS &amp; AOA would never come back in my life again. This was a stupid thought as I was just getting started with coding &amp; I never thought that DS &amp; AOA can play a huge role in the career of a Software Developer.</p><p>So now I’m back to learn DS &amp; AOA so that I remember to implement them during my entire life as a coder. I know some Data Structures &amp; how to analyse Algorithms but my knowledge is not upto my expectations.</p><p>Now I’ll be using <a href="https://www.jackkinsella.ie/articles/janki-method"><strong>ANKI CARDS</strong></a> which uses Spaced Repititions to remember DS for a long time &amp; I’ll be using <strong>GEEKSFORGEEKS</strong> to learn <a href="http://www.geeksforgeeks.org/data-structures/"><strong>DS</strong></a> &amp; <a href="http://www.geeksforgeeks.org/fundamentals-of-algorithms/"><strong>AOA</strong></a> until I complete it &amp; move on to some other resource. Also, I’ll be learning something about DS &amp; AOA daily &amp; I will write a post about it here bcz</p><blockquote>The Best Way to Learn Anything is by Teaching It</blockquote><p>So follow along if you’re doing the same thing or wanna refresh your DS &amp; AOA knowledge. Enough talk, its time for some action.</p><blockquote>My favourite <a href="http://www.imdb.com/title/tt0773262/">Dexter</a> describes it well <strong>“Tonight’s the Night”</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c4528b4519b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Awesome Javascript Reads]]></title>
            <link>https://medium.com/@deadcoder0904/awesome-javascript-reads-82046cc7854d?source=rss-784e5fbd9c36------2</link>
            <guid isPermaLink="false">https://medium.com/p/82046cc7854d</guid>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[awesome]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[goodreads]]></category>
            <dc:creator><![CDATA[Akshay Kadam]]></dc:creator>
            <pubDate>Thu, 12 Jan 2017 20:09:01 GMT</pubDate>
            <atom:updated>2017-01-12T20:09:01.253Z</atom:updated>
            <content:encoded><![CDATA[<p>Here are some awesome javascript resources that I read (not completely, yet they are awesome) :-</p><p>(1) <a href="https://github.com/getify/You-Dont-Know-JS">You Don’t Know JS</a> — Indepth 😍 Javascript by <a href="https://github.com/getify/">Kyle Simpson</a></p><p>(2) <a href="https://github.com/getify/Functional-Light-JS">Functional Light JS</a> — 😎 Functional Javascript by <a href="https://github.com/getify/">Kyle Simpson</a></p><p>(3) <a href="https://github.com/wesbos/es6-articles">ES6 Articles</a> — 😁 Awesome ES6 posts by <a href="https://github.com/wesbos">Wes Bos</a></p><p>(4) <a href="http://speakingjs.com/es5/index.html">Speaking Javascript</a> — 💜 An In-Depth Guide for Programmers who want to learn Javascript by <a href="https://github.com/rauschma">Dr.Axel Rauschmayer</a></p><p>(5) <a href="http://exploringjs.com/es6/index.html">Exploring ES6</a> — ⚡️ An In-Depth book on ECMAScript 6, for JavaScript programmers by <a href="https://github.com/rauschma">Dr.Axel Rauschmayer</a></p><p>(6) <a href="http://exploringjs.com/es2016-es2017/index.html">Exploring ES2016 and ES2017</a> — 🐠 An In-Depth book on ECMAScript 2016–2017, for JavaScript programmers by <a href="https://github.com/rauschma">Dr.Axel Rauschmayer</a></p><p>(7) <a href="https://github.com/sgaurav/understanding-es6">Understanding ES6</a> — Simple examples to help you understand ES6 😉 by <a href="https://github.com/sgaurav">Gaurav Singh</a></p><p>(8) <a href="http://es6.ruanyifeng.com/">Getting Started with ECMAScript 6</a> — 🎃 “ECMAScript 6 Getting Started” is an open source JavaScript language tutorial, a comprehensive introduction to the new ECMAScript 6 introduced the syntax characteristics by <a href="https://github.com/ruanyf">Ruan YiFeng</a> written in <em>Chinese</em>. I have used Google Translate <a href="https://chrome.google.com/webstore/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcleb">Chrome Plugin</a> to translate to English</p><p>(9) <a href="https://github.com/JustinDrake/node-es6-examples">ECMAScript 6 in Node.JS</a> — 🎅 This text introduces and illustrates, with simple examples, ECMAScript 6 (ES6 for short) features natively available in Node by <a href="https://github.com/JustinDrake">Justin</a></p><p>(10) <a href="http://qnimate.com/post-series/ecmascript-6-complete-tutorial/">ECMAScript 6 Complete Tutorial</a> — 📛 Complete ES6 Tutorials by <a href="http://qnimate.com/author/narayanrusty/">Narayan Prusty</a></p><p>(11) <a href="https://ponyfoo.com/books/practical-es6/chapters#toc">Practical ES6</a> — 🍕 A Practical Dive into ES6 and Maintainable JavaScript Modules by <a href="https://github.com/bevacqua">Nicolás Bevacqua</a></p><p>(12) <a href="https://github.com/bevacqua/es6">ES6 in 350 bullet points</a> — 🌟 ES6 Overview in 350 Bullet Points by <a href="https://github.com/bevacqua">Nicolás Bevacqua</a></p><p>(13) <a href="http://samalgorai.com/story/js-stories">Javascript Stories</a> — 🔷 Javascript explained using Stories by <a href="https://github.com/samal">Samal Gorai</a></p><p>(14) <a href="http://bonsaiden.github.io/JavaScript-Garden/">Javascript Garden</a> — 🔥 Growing collection of documentation about the most quirky parts of the JavaScript programming language by <a href="https://github.com/bonsaiden">Ivo Wetzel</a></p><p>(15) <a href="http://ngninja.com/tag/javascript/">Easiest Javascript Posts</a> — 💚 Clear. Concise. And Easy to Understand Javascript Blog Posts by <a href="http://www.shardulbagade.com/">Shardul Bagade</a></p><p>(16) <a href="https://ponyfoo.com/">PonyFoo</a> — 😽 A Blog about the open web, highlighting the most important news every Thursday by <a href="https://github.com/bevacqua">Nicolás Bevacqua</a></p><p>(17) <a href="http://sahatyalkabov.com/jsrecipes/#!/">JS Recipes</a> — 💘 JavaScript tutorials for backend and frontend development by <a href="https://github.com/sahat">Sahat Yalkabov</a></p><p>If there are any other awesome resources that I might’ve missed, please leave a comment below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82046cc7854d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Oh My Zsh]]></title>
            <link>https://medium.com/@deadcoder0904/oh-my-zsh-e4d59b5167f6?source=rss-784e5fbd9c36------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4d59b5167f6</guid>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[zsh]]></category>
            <category><![CDATA[oh-my-zsh]]></category>
            <dc:creator><![CDATA[Akshay Kadam]]></dc:creator>
            <pubDate>Wed, 11 Jan 2017 06:33:11 GMT</pubDate>
            <atom:updated>2017-01-11T06:33:11.912Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Every Developer needs to learn the Original Command-Line Input rather than what is known as Graphical User Interface.</p><p>But, nobody wants to use CMD (Windows) / Bash or Shell (Linux) / Terminal (Mac) because quite frankly it sucks. What if the Terminal has a pretty sleaky UI.</p><p>That’s where <a href="http://ohmyz.sh/">OH MY ZSH</a> comes into the picture.</p><h3>What is Oh-My-Zsh ?</h3><p>Oh-My-Zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout…</p><blockquote>Your terminal never felt this good before.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*MzOo421eWVUKu7n24Eysiw.png" /><figcaption>Taken from https://ohmyz.sh/</figcaption></figure><h3>Installing Zsh</h3><p>In order to install Zsh, follow these steps:</p><p>1. There are two main ways to install Zsh<br> — with the package manager of your choice (_e.g._ <strong><em>sudo apt-get install zsh</em></strong>) or<br> — from <a href="http://zsh.sourceforge.net/Arc/source.html">source</a>, following <a href="http://zsh.sourceforge.net/FAQ/zshfaq01.html#l7">instructions from the Zsh FAQ</a><br>2. Verify installation by running <strong><em>zsh — version</em></strong>. Expected result: <strong><em>zsh 4.3.9</em></strong> or more recent. <br>3. Make it your default shell: <strong><em>chsh -s $(which zsh)</em></strong><br> — Note that this will not work if Zsh is not in your authorized shells list (`<strong><em>/etc/shells</em></strong>`)<br> or if you don’t have permission to use `<strong><em>chsh</em></strong>`. If that’s the case <a href="https://www.google.com/search?q=zsh+default+without+chsh">you’ll need to use a different procedure</a>.<br>4. Log out and login back again to use your new default shell. <br>5. Test that it worked with <strong><em>echo $SHELL</em></strong>. Expected result: <strong><em>/bin/zsh</em></strong></p><h3>Installing Oh-My-Zsh</h3><h4>OPTION 1:</h4><p>(1) Install `<strong><em>curl</em></strong>` first if you don’t have it already</p><blockquote>$ sudo apt-get install curl</blockquote><p>(2) Install `<strong><em>oh-my-zsh</em></strong>` via `<strong><em>curl</em></strong>`</p><blockquote>$ sh -c “$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)&quot;</blockquote><h4>OPTION 2:</h4><p>(1) Install `<strong><em>wget</em></strong>` first if you don’t have it already</p><blockquote>$ sudo apt-get install wget</blockquote><p>(2) Install `<strong><em>oh-my-zsh</em></strong>` via `<strong><em>wget</em></strong>`</p><blockquote>$ sh -c “$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)”</blockquote><h3>Installing New Theme</h3><p>Default Theme is `<strong><em>robbyrussell</em></strong>`, the creator of `<strong><em>Oh-My-Zsh</em></strong>`.</p><p>Download the Theme which you want to use &amp; put it in `<strong><em>~/.oh-my-zsh/themes/</em></strong>`. Note that many themes are already available.</p><p>To remove the original theme, open `<strong><em>~/.zshrc</em></strong>` in your favourite text editor &amp; remove or comment (#) the following line</p><blockquote>ZSH_THEME=”robbyrussell”</blockquote><p>Then add the following line with the theme of your choice which can be found <a href="https://github.com/robbyrussell/oh-my-zsh/wiki/Themes">here</a>.</p><blockquote>ZSH_THEME=”cute-theme”</blockquote><p>This is the theme I’m currently using.</p><h3>Install Some Plugins</h3><p>Oh My Zsh comes with a shit load of plugins to take advantage of. You can take a look in the <a href="https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins">plugins</a> directory and/or the <a href="https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins">wiki</a> to see what’s currently available.</p><p>Download the Plugins which you want to use &amp; put it in `<strong><em>~/.oh-my-zsh/plugins/</em></strong>`. Note that many plugins are already available.</p><p>Open `<strong><em>~/.zshrc</em></strong>` in your favourite text editor &amp; add some plugins you want to use.</p><blockquote>plugins=(colorize git git-open hacker-quotes jsontools sudo zsh-256color rand-quote)</blockquote><p>This are the plugins I’m currently using.</p><h3>My Awesome ZSH</h3><p>This is what my current Z shell looks like with 2 themes.</p><h4>(1) Monokai Soda</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*F-Va54sqV1iNVTdP4QPHoA.png" /></figure><h4>(2) Solarized Dark</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*bljiSpQv-17ysniN9bDFcA.png" /></figure><p><em>Originally published at </em><a href="https://deadcoder0904.github.io/"><em>https://deadcoder0904.github.io/</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4d59b5167f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sublime for Programmers]]></title>
            <link>https://medium.com/@deadcoder0904/sublime-for-programmers-f1f8151e7860?source=rss-784e5fbd9c36------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1f8151e7860</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[sublime-text-3]]></category>
            <category><![CDATA[text-editor]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Akshay Kadam]]></dc:creator>
            <pubDate>Tue, 10 Jan 2017 08:46:24 GMT</pubDate>
            <atom:updated>2017-01-10T08:46:24.983Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sublime Text</h3><p>Sublime Text is a sophisticated text editor for code, markup and prose.</p><p>You’ll love the slick user interface, extraordinary features and amazing performance.</p><p>The official site puts it right,</p><blockquote>`Sublime Text` is the text editor you’ll fall in love with.</blockquote><h3>My Opinionated Workflow</h3><p>Previously, I’ve been using `Jetbrains` for my Programming Purposes.</p><p>It was slow because of my RAM is not that great &amp; required a lot of RAM to initially load up.</p><p>Recently, I’ve switched to `Sublime Text` because of its clean interface.</p><h3>Installing Sublime Text</h3><p>First, head over to the <a href="https://sublimetext.com/">Official Site</a> &amp; download sublime for your Operating System.</p><p>Install it. Keep everything to the default.</p><p>As I’m an aspiring <em>Full Stack Developer</em>, so I have some essential <em>Packages</em> that I use to reduce the amount of KeyStrokes I perform.</p><h3>Installing Package Control</h3><p>Head over to the <a href="https://packagecontrol.io/">Official Site</a> &amp; then click on <em>Install Now</em> then under the <em>Manual</em> tab follow the instructions to install <em>Package Control</em>.</p><p>Once it is installed you may need to <em>Restart Sublime Text</em>.</p><p>You can type <strong><em>Ctrl+Shift+P</em></strong> to open Search option &amp; type <strong><em>install package</em></strong> if the dropdown list comes like <strong><em>Package Control: Install Package</em></strong> then you’ve successfully installed <strong><em>Package Control</em></strong>, otherwise follow the instructions properly.</p><p><strong>Installing a Theme known as `<em>Cobalt2</em>`</strong></p><p>I’ve been a huge fan of <a href="https://wesbos.com/">Wes Bos’s</a> `<strong><em>Cobalt2</em></strong>` Theme. Head over to its <a href="https://github.com/wesbos/cobalt2">Github Page</a> for the Installation instructions.</p><p>After installation, your text editor might look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Woi-I1DVwOcvXXNnaozMw.png" /></figure><p><strong>Installing some necessary Front End Development Packages</strong></p><p>(1) <a href="http://emmet.io/">Emmet</a> — It is a plugin for many popular text editors which greatly improves HTML &amp; CSS workflow</p><p>Here’s an example: Type this</p><blockquote>ul&gt;li*5</blockquote><p>&amp; press <strong><em>Tab</em></strong> can be transformed into</p><blockquote>&lt;ul&gt;<br> &lt;li&gt;&lt;/li&gt;<br> &lt;li&gt;&lt;/li&gt;<br> &lt;li&gt;&lt;/li&gt;<br> &lt;li&gt;&lt;/li&gt;<br> &lt;li&gt;&lt;/li&gt;<br>&lt;/ul&gt;</blockquote><p>(2) <a href="https://packagecontrol.io/packages/JavaScript%20Completions">Javascript Completions</a> — It helps you to write your scripts more quickly with hints and completions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*cXIZCTTiVsQzMTif41_znw.gif" /></figure><h4><strong>Some other Packages I use you may not need</strong></h4><p>(1) <a href="https://github.com/babel/babel-sublime">Babel</a> — Syntax definitions for ES6 JavaScript with React JSX extensions.</p><p>(2) <a href="https://github.com/babel/babel-sublime-snippets">Babel Sublime Snippets</a> — Sublime snippets for React in ES5 and ES6 flavors.</p><p>(3) <a href="https://github.com/viisual/ASCII-Decorator">ASCII Decorator</a> — Convert selected text into banners made up of ASCII art.</p><p>(4) <a href="https://github.com/Monnoroch/ColorHighlighter">Color Highlighter</a> — Highlight CSS colours in Sublime Text.</p><p>(5) <a href="https://github.com/ethanal/SublimeEmoji/">Emoji</a> — A simple Sublime Text 3 plugin to insert emoji from the command palette.</p><p>(6) <a href="https://github.com/spadgos/sublime-jsdocs">DocBlockr</a> — Simplifies writing DocBlock comments in Javascript, PHP, CoffeeScript, Actionscript, C &amp; C++.</p><p>(7) <a href="https://github.com/revolunet/sublimetext-markdown-preview">MarkdownPreview</a> — Markdown preview and build plugin for sublime text 2/3.</p><p>(8) <a href="https://github.com/alienhard/SublimeAllAutocomplete">AllAutocomplete</a> — Extend Sublime autocompletion to find matches in all open files of the current window.</p><p>This made my development workflow easier. Hope it helps you.</p><p>If you know some other packages I missed which will make my development workflow easy, please comment below.</p><p><em>Originally published at </em><a href="https://deadcoder0904.github.io/"><em>https://deadcoder0904.github.io/</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1f8151e7860" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>