<?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 YU SHI on Medium]]></title>
        <description><![CDATA[Stories by YU SHI on Medium]]></description>
        <link>https://medium.com/@yushi95?source=rss-bd50029fbd60------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HbEbdM8TF_nPqjsbMtyWIA@2x.jpeg</url>
            <title>Stories by YU SHI on Medium</title>
            <link>https://medium.com/@yushi95?source=rss-bd50029fbd60------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 15:46:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yushi95/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[How to Create a Beautiful README for Your GitHub Profile]]></title>
            <link>https://yushi95.medium.com/how-to-create-a-beautiful-readme-for-your-github-profile-36957caa711c?source=rss-bd50029fbd60------2</link>
            <guid isPermaLink="false">https://medium.com/p/36957caa711c</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[profile]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[branding]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[YU SHI]]></dc:creator>
            <pubDate>Fri, 25 Jun 2021 12:03:07 GMT</pubDate>
            <atom:updated>2021-06-25T13:52:43.052Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*b29pJKZqp6Jxb3rd9QlJiw.png" /></figure><p>Do you want to make your GitHub profile stand out? If you do, then you are in the right place. It’s good to have a stunning GitHub profile. Especially for people who want to present themselves online. It’ll be like LinkedIn where you can show off your work and skills. In this article, I’m going to show you how to take your GitHub profile to the next level. I am going to use my own GitHub profile as an example. I’ve attached my GitHub profile link and screenshot below.</p><p><a href="https://github.com/yushi1007">yushi1007 - Overview</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FZE3HTtIb6JXxBP5" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yqMTzZuqT0eUrLrj" /></figure><p>In this article, you’ll get to see the following things:</p><ul><li><strong>Creating a README.md file</strong></li><li><strong>How to add images</strong></li><li><strong>How to add badges</strong></li><li><strong>How to add GitHub Status Card</strong></li><li><strong>How to add social media icons</strong></li><li><strong>How to add link to the text</strong></li></ul><h3><strong>Creating a README.md File</strong></h3><p>In order to show the content in your GitHub profile page, you have to create a <strong>README.md</strong> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*maWuRsIhgjBLtp0j" /></figure><ol><li>Create a new repository with your GitHub username.</li><li>Check the<strong> “Add a README file”</strong> box.</li><li>After you create the <strong>README.md</strong> file, GitHub will show you with the option to edit the file.</li><li>Git clone the <strong>README.md</strong> repository you just created.</li><li>Open the README.md file in Visual Studio Code or other text editor you are using.</li><li>It’s time to add cool content to the <strong>README.md</strong> file.</li></ol><h3><strong>How to Add Images</strong></h3><p>For the banner, I am using <strong>Photoshop</strong> to create my own banner. You can also use <a href="https://www.canva.com/search/templates?q=banner&amp;organic=true"><strong>Canva</strong></a> to create a beautiful banner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JkWEo400nDymhtnl" /></figure><ol><li>If you are using an image from your desktop file, you need to drag the image to your repository issues input box to get the url. (example below)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0Ag-uWrHCQD6swZ8" /></figure><p>2. After you drag the image to the repository issues input box, it will generate the image url for you.</p><p>3. Copy and paste the image url to the code below.</p><p><strong><em>&lt;img src=”https://userimages.githubusercontent.com/75753187/123358567-aac7b900-d539-11eb-8275-0b380264bb4c.png&quot; alt=”my banner”&gt;</em></strong></p><p>4. Put this code into your <strong>README.md file.</strong></p><p>5. Something to note here is, you can’t use the <strong>CSS</strong> file for the code in the <strong>README.md</strong>. You have to style inside the <strong>HTML</strong> element if you want to align or size the image. (example below)</p><p><strong><em>&lt;p align=”center”&gt;</em></strong></p><p><strong><em>&lt;img width=”200&quot; height=”200&quot; src=”https://user-images.githubusercontent.com/75753187/123358567-aac7b900-d539-11eb-8275-0b380264bb4c.png&quot; alt=”my banner”&gt;</em></strong></p><p><strong><em>&lt;/p&gt;</em></strong></p><h3><strong>How to Add Badges</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6HOvND4nEiUSL8wB" /></figure><ol><li>To add the badges in the <strong>README.md</strong> file, please check out the following resources:</li></ol><ul><li><a href="https://github.com/Ileriayo/markdown-badges">GitHub - Ileriayo/markdown-badges: Badges for your personal developer branding, profile, and projects.</a></li><li><a href="https://github.com/badges/shields">GitHub - badges/shields: Concise, consistent, and legible badges in SVG and raster format</a></li><li><a href="https://shields.io/category/build">Shields.io: Quality metadata badges for open source projects</a></li><li><a href="https://badgen.net/">Badgen</a></li><li><a href="https://dev.to/envoy_/150-badges-for-github-pnk">📛 Awesome Badges</a></li></ul><p>2. You can use all the resources above to get or create your own badges.</p><p>3. You can use the following code to show your badges.</p><p><strong><em>&lt;img alt=”React” src=”https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&amp;logo=react&amp;logoColor=%2361DAFB&quot;/&gt;</em></strong></p><p>Or</p><p><strong><em>![](https://img.shields.io/badge/Code-React-informational?style=flat&amp;logo=react&amp;color=61DAFB)</em></strong></p><h3><strong>How to add GitHub Status Card</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AsURyTQszasu9SsX" /></figure><p>You can also add a cool GitHub status card to your GitHub profile. It will show you real time stats for your GitHub account.</p><ol><li>Check out the <strong>github-readme-stats</strong> below, created by <strong>Anurag Hazra</strong>.</li></ol><p><a href="https://github.com/anuraghazra/github-readme-stats">GitHub - anuraghazra/github-readme-stats: :zap: Dynamically generated stats for your github readmes</a></p><p>2. If you want to use the one I am using, then copy and paste the code below.</p><p><strong><em>[![Anurag’s github stats](https://github-readme-stats.vercel.app/api?username=yushi1007)](https://github.com/yushi1007)</em></strong></p><p><strong><em>[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=yushi1007&amp;layout=compact)](https://github.com/yushi1007)</em></strong></p><p>3. Make sure change my GitHub username <strong>yushi1007</strong> to your GitHub username.</p><p>4. Only change the username, don’t change anything else.</p><h3><strong>How to Add Social Media Icons</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*atab7o2YwwSSXIyC" /></figure><p>For the social media icons, I am using the<strong> </strong><a href="https://www.flaticon.com/"><strong>flaticon</strong></a> website. You can also use the badges for the social media icons. Feel free to create your own icons. You don’t have to follow my style. I believe you can create a profile even more beautiful than my GitHub profile.</p><ol><li>Create an <strong>images</strong> folder for the icons. (I’ve attached my images folder link below)</li></ol><p><a href="https://github.com/yushi1007/yushi1007/tree/main/images">yushi1007/yushi1007</a></p><p>2. Import all the icons to the <strong>images</strong> folder.</p><p>3. Use the code below.</p><p><strong><em>&lt;a href=”https://www.linkedin.com/in/yushi95/&quot;&gt;&lt;img align=”left” src=”https://raw.githubusercontent.com/username/reponame/branch/foldername/icon.svg&quot; alt=”icon | LinkedIn” width=”21px”/&gt;&lt;/a&gt;</em></strong></p><p>4. Enter your username, repo name, branch, folder name, and file name. (example below)</p><p><strong><em>&lt;a href=”https://www.linkedin.com/in/yushi95/&quot;&gt;&lt;img align=”left” src=”https://raw.githubusercontent.com/yushi1007/yushi1007/main/images/linkedin.svg&quot; alt=”Yu Shi | LinkedIn” width=”21px”/&gt;&lt;/a&gt;</em></strong></p><p>5. Make sure change the LinkedIn link to your own link.</p><h3><strong>How to Add Link to the Text</strong></h3><p>There is another way to link the text in the <strong>README.md</strong> file without using <strong><em>&lt;a href=“”&gt;&lt;/a&gt;</em></strong>.</p><ol><li>Without the <strong><em>&lt;a href=“”&gt;&lt;/a&gt;</em></strong></li></ol><p><strong><em>Hi there, I am [Yu](https://www.yushi.dev/)</em></strong></p><p>2. With the <strong><em>&lt;a href=“”&gt;&lt;/&gt;</em></strong></p><p><strong><em>Hi there, I’m &lt;a href=”https://www.yushi.dev/&quot; target=”_blank” rel=”noreferrer”&gt;Yu&lt;/a&gt; 👋</em></strong></p><p>3. I am using <strong><em>&lt;a href=“”&gt;&lt;/a&gt;</em></strong> because I need to align the text to center</p><p><strong><em>&lt;h3 align=”center”&gt;</em></strong></p><p><strong><em>Hi there, I’m &lt;a href=”https://www.yushi.dev/&quot; target=”_blank” rel=”noreferrer”&gt;Yu&lt;/a&gt; 👋</em></strong></p><p><strong><em>&lt;/h3&gt;</em></strong></p><h3>Conclusion</h3><p>Please check out the following GitHub profiles for more inspiration:</p><ul><li><a href="https://github.com/codeSTACKr">codeSTACKr - Overview</a></li><li><a href="https://github.com/abhisheknaiidu">abhisheknaiidu - Overview</a></li></ul><p>Hope this article gave you enough inspiration to create your own GitHub profile. Try to get your own unique design ideas by looking at other GitHub profile.</p><p>I’ve attached my README.md markdown code below for reference.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/11a6d0e5ca2de1704dde3174aee00079/href">https://medium.com/media/11a6d0e5ca2de1704dde3174aee00079/href</a></iframe><p>It’s time to start designing your own GitHub profile. I’d love to see it. Feel free to share with me after you are done. I look forward to hearing from you. Please let me know if something is still confusing or I miss something. Thank you so much for reading my blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36957caa711c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Rails API Backend to Heroku and React Frontend to Netlify]]></title>
            <link>https://yushi95.medium.com/deploy-rails-api-backend-to-heroku-and-react-frontend-to-netlify-b515239d5022?source=rss-bd50029fbd60------2</link>
            <guid isPermaLink="false">https://medium.com/p/b515239d5022</guid>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[netlify]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[rails]]></category>
            <dc:creator><![CDATA[YU SHI]]></dc:creator>
            <pubDate>Thu, 27 May 2021 12:02:06 GMT</pubDate>
            <atom:updated>2021-06-10T19:27:25.371Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3MVVfER3VJv1bvhOkx5klA.png" /></figure><p>Congratulations, you have created an awesome application by using <strong>Rails API</strong> for backend and <strong>React</strong> for frontend. Now, it’s time to show your application to the world.</p><p>In this article, I am going to show you how to deploy your <strong>Rails API</strong> to <strong>Heroku</strong> and <strong>React</strong> to <strong>Netlify</strong>. The following topics will be covered:</p><ul><li><strong>Convert your SQLite database to PostgreSQL</strong></li><li><strong>Check your Ruby version</strong></li><li><strong>Deploy backend Rails API to Heroku</strong></li><li><strong>Deploy frontend React to Netlify</strong></li></ul><h3>Convert your SQLite database to PostgreSQL</h3><p>If you are using the <strong><em>SQLite</em></strong> database, you need to convert it to <strong><em>PostgreSQL</em></strong>. If you don’t have <strong><em>PostgreSQL</em></strong>, you can download it <a href="https://www.postgresql.org/"><strong>here</strong></a>.</p><p><strong>1.</strong> You have to delete your <strong><em>Gemfile.lock</em></strong> in your directory folder if you are going to convert your database.</p><p><strong>2.</strong> In the <strong><em>Gemfile</em></strong>, change <strong><em>gem ‘sqlite3’</em></strong> to <strong><em>gem ‘pg’</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*5WkvTK7cDmjbFv7n" /></figure><blockquote>to</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/0*FCkYIvLP3q30I8Zp" /></figure><p><strong>3.</strong> Run <strong><em>bundle install</em></strong>.</p><pre>bundle install</pre><p><strong>4.</strong> Go to your <strong><em>database.yml</em></strong> file inside your <strong><em>config</em></strong> folder, remove all the <strong><em>SQLite</em></strong> code. Copy and paste the code below into your <strong><em>database.yml</em></strong> file. Make sure change the info to your info inside this code.</p><pre># PostgreSQL</pre><pre>default: &amp;default<br>adapter: postgresql<br>encoding: unicode<br>pool: &lt;%= ENV.fetch(“RAILS_MAX_THREADS”) { 5 } %&gt;</pre><pre>development:<br>&lt;&lt;: *default<br># Your app name(e.g. my app directory folder name is fotoset-backend)<br>database: fotoset_backend_development<br># you need to put your username and password here<br>username: Your PostgreSQL server name<br>password: The password you are using to login into your computer</pre><pre>test:<br>&lt;&lt;: *default<br># Your app name(e.g. my app directory folder name is fotoset-backend)<br>database: fotoset_backend_test</pre><pre>production:<br>&lt;&lt;: *default<br># Your app name(e.g. my app directory folder name is fotoset-backend)<br># you don’t need username and password here below<br>database: fotoset_backend_production<br>username: fotoset_backend<br>password: &lt;%= ENV[‘FOTOSET_BACKEND_DATABASE_PASSWORD’] %&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hjLFn9HP6pp-n9gd" /></figure><p><strong>5.</strong> Make sure your <strong>PostgreSQL</strong> is running</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D4yW2MGeGllhbEYt" /></figure><p><strong>6.</strong> Run <strong><em>rails db:setup</em></strong>, <strong><em>rails db:migrate</em></strong>, and <strong><em>rails db:seed</em></strong>.</p><p><strong>7.</strong> Run <strong><em>rails s</em></strong>, go to your server <strong>localhost:3000</strong> to check if everything is good.</p><h3><strong>Check your Ruby version</strong></h3><p>In order to deploy your application successfully, you might have to update your Ruby version. It’s because Heroku doesn’t support the old Ruby version. Skip this part if you already have the latest version(3.0.1).</p><p><strong>1.</strong> Open you backend directory folder.</p><p><strong>2</strong>. Check your Ruby version by typing <strong><em>ruby -v</em></strong> in your terminal.</p><pre>ruby -v</pre><p><strong>3.</strong> Update Ruby version in your terminal <strong><em>rvm install 3.0.1</em></strong> if you don’t have the latest version. It takes a few minutes to install.</p><pre>rvm install 3.0.1</pre><p><strong>4.</strong> Once done, run <strong><em>rvm use 3.0.1</em></strong> in your app directory folder terminal. Check Ruby version again <strong><em>ruby -v</em></strong> to make sure you have the latest version now.</p><pre>rvm use 3.0.1</pre><p><strong>5.</strong> Go to your <strong><em>Gemfile</em></strong>, change the Ruby version to what you have now<strong><em> ruby 3.0.1</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/0*JS6UxNnHcUL5JCXz" /></figure><p><strong>6.</strong> Go to your <strong><em>.ruby-version</em></strong> file in your directory folder, change the ruby version to <strong><em>ruby-3.0.1</em></strong>.</p><p><strong>7.</strong> Run <strong><em>bundle install</em></strong>.</p><pre>bundle install</pre><p><strong>8.</strong> Go to your <strong><em>Gemfile.lock</em></strong>, copy and paste following to your <strong><em>Gemfile.lock</em></strong> if you don’t have them in your file. Heroku doesn’t let me deploy my app if I don’t have the following.</p><pre>nokogiri (1.11.3-x86_64-linux)<br>  racc (~&gt; 1.4)<br>nokogiri (1.11.4-x86_64-darwin)<br>  racc (~&gt; 1.4)</pre><pre>PLATFORMS<br>  x86_64-darwin-20<br>  x86_64-linux</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/0*EYut4rpbNxh81ojM" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*x9ZV_VChD_-fDjJE" /></figure><h3><strong>Deploy backend Rails API to Heroku</strong></h3><ol><li>Create a <a href="https://signup.heroku.com/"><strong>Heroku account</strong></a>.</li><li>Install the <strong>Heroku CLI</strong> in your terminal. You can find instructions <a href="https://devcenter.heroku.com/articles/heroku-cli"><strong>here</strong></a>. I use this command: <strong><em>brew tap heroku/brew &amp;&amp; brew install heroku</em></strong>.</li></ol><pre>brew tap heroku/brew &amp;&amp; brew install heroku</pre><p>3. Make sure you login into Heroku website, then run <strong><em>heroku login</em></strong> in the terminal.</p><pre>heroku login</pre><p>4. Run <strong><em>heroku create</em></strong>, it will show you Heroku information in the terminal. Heroku will give you a random Heroku app name. You can change the name <a href="https://devcenter.heroku.com/articles/renaming-apps#updating-git-remotes"><strong>here</strong></a><strong> </strong>after you finish all the steps.</p><pre>heroku create</pre><p>5. Run <strong><em>git push heroku main</em></strong> to push your app files to heroku.</p><pre>git push heroku main</pre><p>6. Run <strong><em>heroku run rake db:migrate</em></strong> and <strong><em>heroku run rake db:seed</em></strong> to host all your data in Heroku server. You can checkout my data here: <a href="https://fotoset.herokuapp.com/users"><strong>https://fotoset.herokuapp.com/users</strong></a></p><pre>heroku run rake db:migrate</pre><pre>heroku run rake db:seed</pre><p>7. Go to your Heroku website, I recommend connect your app GitHub repo with Heroku(image below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5gYL2T_njGT2ttzI" /></figure><p>8. You can also run <strong><em>heroku open</em></strong> in the terminal to run the Heroku server, the url will be like this <a href="https://fotoset.herokuapp.com/users"><strong>https://fotoset.herokuapp.com/</strong></a> after you run the command.</p><pre>heroku open</pre><p>Now, you don’t have to run rails s to get your data anymore. Hope this is helpful to you all. Please let me know if you have any questions or feedback! I am happy to help you out.</p><h3><strong><em>Deploy frontend React to Netlify</em></strong></h3><ol><li>Create a <strong><em>_redirects</em></strong> file inside the <strong><em>public</em></strong> folder and copy and paste this code <strong><em>/* /index.html 200</em></strong>. Only if you are using <strong><em>react-router-dom</em></strong>. To prevent getting the error message after refresh your website page.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xjLd3cL0PNSxZSX4" /></figure><p>2. Create a <strong><em>Netlify </em></strong><a href="https://app.netlify.com/"><strong><em>account</em></strong></a>.</p><p>3. Go to <strong><em>New site from Git</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N1ruQV5BCcz7QgYT" /></figure><p>4. Connect <strong><em>Netlify</em></strong> to <strong><em>GitHub</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xqz9u_0ZxjnRXCWh" /></figure><p>5. Search you GitHub repo, then press enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3rVlj2qkx150yXQw" /></figure><p>6. Choose the frontend repo you want to deploy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WqdeRY1Qc7EOJbl9" /></figure><p>7. Build command: <strong><em>CI= npm run build</em></strong>, then click Deploy site.</p><p>8. You can change you site name in the site setting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o543Hjh3Nuw86Eek" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JJuBr-AHfVtkO4FM" /></figure><p><strong>9. </strong>Change all your frontend fetch url to heroku url (e.g. image below)</p><p>http://localhost:3000/photos =&gt;<strong> </strong>https://fotoset.herokuapp.com/photos</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*xRopkKpzSJn6FxkRHCza8A.png" /></figure><h3><strong>Bonus:</strong></h3><p>You will need to put your API key in <strong><em>Heroku Config Vars</em></strong> if you are using any API key in the backend. Same as Frontend, put your API key in <strong><em>Netlify Environment Variables</em></strong> if you are using any API key in the frontend.</p><h4>Heroku</h4><ol><li>Choose the app that you are using a API key</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MMmGlBkqzgd2DU_j" /></figure><p>2. Go to the app setting, then click the Reveal Config Vars</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MCQzJqq6_qXGdJiF" /></figure><p>3. Copy and paste your API key variable name and key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ooRaVK_wspZ_R-QR" /></figure><h4>Netlify</h4><ol><li>Choose the app that you are using a API key</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PzwaaPt2_j0Ge4GA" /></figure><p>2. Go to Domain setting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iOI1k5lYQ02DXFqe" /></figure><p>3. Go to Environment, click the Edit variables and add your API key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5f0WMstAnsaBZLC3" /></figure><p>Thank you so much for following all the steps in this article. I hope this article helps everyone to deploy the website. If you think I explained something wrong or unclear, please leave a message in the comment. I am happy to help you out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b515239d5022" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Animation Login Popup Form by Using React State Hook and CSS]]></title>
            <link>https://medium.com/geekculture/animation-login-popup-form-by-using-react-state-hook-and-css-7ecf803f1fa9?source=rss-bd50029fbd60------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ecf803f1fa9</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[YU SHI]]></dc:creator>
            <pubDate>Fri, 23 Apr 2021 15:15:27 GMT</pubDate>
            <atom:updated>2021-04-26T22:44:27.341Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xmF67Vj7eYbE4qwSj9yY2A.png" /></figure><p>Do you like to have cool animation popup forms in your application? If you do, then you are in the right place. Recently, I had fun playing with <strong>React State Hooks</strong> and <strong>CSS</strong>. I discovered that <strong>React State</strong> can do so many cool things with <strong>CSS</strong>. Implementing animation to an app can greatly improve the customer experience and make your app feel more professional. In this article, I am going to show you how to make an animation login popup form by using <strong>State Hook</strong> and <strong>CSS</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*SEQQbJIaDCeKJurZlOTFTA.gif" /></figure><p><strong>How to get started:</strong></p><p>Before we start, you should already know what is State in React and how the React component works. First, we have to create all the components that we need. We are going to create simple <strong>NavBar</strong> and <strong>LoginForm </strong>components in our react app <strong>src</strong> folder. And we will import <strong>NavBar</strong> and <strong>LoginForm</strong> components to the <strong>App</strong> component.</p><p><strong>LoginForm Component Code:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YFcyDBajY4skC9r0" /></figure><p><strong>NavBar Component Code:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wyELzNKDAlg7vIg0" /></figure><p><strong>App Component Code:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K1z97TVJiloV1DUC" /></figure><p><strong>Let’s take a look at the styles.css file:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*POxFvHEGl-8PSkG3" /></figure><p>All the images above, they are all set up. I will explain them step by step. After we have all of our components set up. We know that the <strong>App</strong> is the parent component. <strong>NavBar</strong> and <strong>LoginForm</strong> are the child components. We import <strong>NavBar</strong> and <strong>LoginForm </strong>to the<strong> App </strong>because we want them to show in the website page(<strong>App</strong> component is inside the <strong>index</strong> component).</p><p>Now, we are going to import <strong>useState Hook from React</strong> <strong>import React, { useState } from “react”; </strong>in order to use<strong> State Hook. </strong>Let’s declare a <strong>State</strong> variable for our popup form, which we’ll call it <strong>isShowLogin</strong>. Our variable is called <strong>isShowLogin</strong>, but we could call it anything else, like <strong>isShow</strong> or <strong>apple</strong>. I recommend calling the variable something that makes sense to you. When you go back look at the variable, you will immediately know what this <strong>State </strong>uses for. We call the variable isShowLogin, so we know it’s for our popup login form. When the app gets very big, we want to make sure we know what is everything used for.</p><p>Next, we are going to make an arrow function called <strong>handleLoginClick. </strong>This function is for us to use the <strong>setIsShowLogin</strong> to update our state. Then we are going to pass down the <strong>handleLoginClick </strong>function to <strong>NavBar</strong> because our login button is inside the <strong>NavBar</strong> component.</p><p>We have to invoke the <strong>handleLoginClick </strong>function in the <strong>NavBar</strong> component, which we have to make a <strong>handleClick</strong> function in the <strong>NavBar</strong>. So we can do <strong>onClick={handleClick}</strong> in the login button. At this moment, we have our <strong>NavBar</strong> login button setup. Now, let’s pass down the <strong>isShowLogin </strong>to <strong>LoginForm</strong> component from the <strong>app </strong>component.</p><p>In the <strong>LoginForm</strong> component, we see that our isShowLogin is inside the <strong>div</strong> <strong>className (className={`${!isShowLogin ? “active” : “”} show`}). </strong>We are not doing anything like <strong>null</strong> to hide the login form because we want to use <strong>CSS</strong> to hide the form for us.</p><p>This is the basic CSS setting:</p><p><strong>.Show{</strong></p><p><strong>-Transition property is 800ms :</strong> the duration of the animation 800 milliseconds=0.8 second. We can set it to any speed we want, but we don’t want it to move slow and fast. 800 millisecond is good.</p><p><strong>-Opacity is 1</strong> <strong>:</strong> not transparent when the login form shows up</p><p><strong>}</strong></p><p><strong>.show.active {</strong></p><p><strong>-transform: translateY(100px)</strong> : it will move the object to the Y axis, <strong>scale(0)</strong> : scale down the current object to 0 = disappear, and <strong>rotateY(180deg)</strong>: rotate the form in 180 degree</p><p><strong>-Opacity is 0</strong> <strong>:</strong> transparent in the beginning</p><p><strong>}</strong></p><p>As we all can see that our form doesn’t show up in the beginning because we set it to <strong>false </strong>in our <strong>useState(false). </strong>If we remove the <strong>.show.active </strong>in<strong> CSS</strong>, the login form will not hide anymore. Hope you all enjoy reading this React State Hook and CSS animation blog.</p><p>Please try it on your own. I’ve attached the link to <strong>CodeSandbox</strong> below. You can test everything out there. Please let me know if something is still confused or I miss something. Thank you so much for reading my blog.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F8z817&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2F8z817&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F8z817%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a4d160332003ee16036a9e1dfdaca28/href">https://medium.com/media/4a4d160332003ee16036a9e1dfdaca28/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ecf803f1fa9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/animation-login-popup-form-by-using-react-state-hook-and-css-7ecf803f1fa9">Animation Login Popup Form by Using React State Hook and CSS</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Checklist ✅ for Rails Application ]]></title>
            <link>https://yushi95.medium.com/checklist-for-rails-application-30868cb4f48b?source=rss-bd50029fbd60------2</link>
            <guid isPermaLink="false">https://medium.com/p/30868cb4f48b</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[checklist]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[YU SHI]]></dc:creator>
            <pubDate>Wed, 10 Mar 2021 17:26:22 GMT</pubDate>
            <atom:updated>2021-03-10T17:26:22.928Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*trIm0lx6gBqDS9deA-PhYA.jpeg" /></figure><p>When we create an application by using Ruby on Rails, we don’t just start making whatever app that comes to our mind. It will make us very confused. And things will get very complicated. We don’t want this to happen when we make our Rails app. We want to do the app step by step. A checklist will help us to stay organized in managing various tasks. We will be sure that no steps in a process will be skipped or forgotten.</p><p>In this article, we are going to make a checklist for Rails app 📋</p><p><strong>1. Draw out the entity-relationship diagram (ERD) for your Rails app (e.g. image below)</strong></p><ul><li>How many models do you have? (e.g. User, Pet, UserPet)</li><li>What is the models’ relationship? (belongs_to? or has_many?)</li><li>Each model’s attribute (e.g. name:string, description:string, age:integer)</li><li>What is in the controller and view for each model? (e.g. index, new, show, create, edit, update, destroy)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3eEUN01M-gncNfqP" /></figure><p><strong>2. Start the Rails app</strong></p><ul><li>Run the ‘<strong>rails new name_of_app</strong>’ command in the terminal</li><li>It will creates a new Rails application with a default directory structure</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LZjwDKufhZDyQmkB" /></figure><p><strong>3. Open the app on your text editor</strong></p><ul><li>Run the server(type ‘<strong>rails s</strong>’ command in the terminal) to check if the app work on the website</li><li>Yay! You’re on Rails!</li><li>Run ‘<strong>bundle install</strong>’ command in the terminal. You can always add a gem later that you want to use while you are working on the app(e.g. gem ‘faker’, gem ‘bcrypt’, gem ‘tty-prompt’, gem ‘colorize’.) You run the ‘bundle install’ again after you add the new gem.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jbsNM90uTrc8eX3x" /></figure><p><strong>4. Start to generate the model, controllers, and view files</strong></p><ul><li>Run the ‘<strong>rails g model User name age:integer bio</strong>’ command (this will generate the User model, migration file, and table for you.) We don’t need the ‘<strong>:string’</strong> for name and bio because Rails magic ✨ (Rails will make every attribute as a string if you don’t specify.) — Model is singular</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*obE_WP17wLFJj4xH" /></figure><ul><li>Run the ‘<strong>rails g controller Users</strong>’ command to generate the controller. Also you can run ‘<strong>rails g controller Users index new show create edit destroy</strong>’ command (this will make all the method and view file for you)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/0*LTpIgLeDELga87XG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/0*_cGQv5XKuSl2Vah_" /></figure><ul><li>There is another command which is even faster ‘<strong>rails g resource User name age:integer bio </strong>’. This all depends on which model you have. You can do ‘<strong>rails g resource UserPet user:belongs_to pet:belongs_to’. </strong>Don’t worry about the plural if you are using ‘<strong>rails g resource’ </strong>because<strong> </strong>Rails magic ✨<strong> </strong>. It will generate all the files for you:</li><li>A model file</li><li>A migration file</li><li>A controller file</li><li>Corresponding view file</li></ul><p><strong>5. Write out all the relationships for each model</strong></p><p><strong>For example:</strong></p><p><strong>User model</strong></p><ul><li>has_many :user_pets, dependent: :destroy</li><li>has_many :pets, through: :user_pets</li></ul><p><strong>UserPet Model</strong></p><ul><li>belongs_to :pet</li><li>belongs_to :user</li></ul><p><strong>Pet model</strong></p><ul><li>has_many :user_pets, dependent: :destroy</li><li>has_many :users, through: :user_pets</li></ul><p><strong>6.</strong> Check all the model relationships and tables before you run ‘<strong>rails db:migrate</strong>’ command, because you don’t want to do the actual jobs in the terminal. It’s because you can’t just change the column name or delete the table in the file. You have to do it in the terminal if you want to delete the column or table.</p><ul><li>Run ‘<strong>rails g migration DropTablename</strong>’ command to delete table</li><li>Run ‘<strong>rails g migration RemoveAgeFromUser age:integer</strong>’ to remove column</li><li>After delete the table or column, then run the ‘<strong>rails db:migrate</strong>’ again</li></ul><p><strong>7. After you did everything above, then make sure to check the schema to see if every table has the correct column. You have to look at your schema to make you seed data(e.g. image below)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JQKO3mn7fR-Dhu4r" /></figure><p><strong>8.</strong> Run ‘<strong>rails db:seed</strong>’ command in the terminal after you write out all your seed data</p><p><strong>9.</strong> Run ‘<strong>rails c</strong>’ (go to the console) to test all the model relationships. Make sure everything is working after you seeded the data</p><p><strong>10.</strong> Start writing out all the methods in the controller (<strong>index, new, show, create, edit, destroy</strong>). The “<strong>index new create show edit destroy</strong>” will create actions in your controller and view files for each of them</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SFw2wO0qzYAbsEnr" /></figure><p><strong>11.</strong> After you write out everything in the controller, then update the routes for every action.(e.g. image below) You also can use ‘<strong>resources :videogames</strong>’, but I highly recommend writing all the routes out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZuT18Gj78s12L9Ti" /></figure><p><strong>12. Set up your view files after the controllers and routes are done</strong></p><p><strong>13.</strong> Now you can start to run ‘<strong>rails s</strong>” to check out each view on the server. The server will tell you what is going on and if there is an error. Some errors might be easy to fix and some might take a little longer to figure out</p><p>I hope this article helps everyone make their Rails application successfully. If you think I explained something wrong or unclear, or if you think I am missing some steps, please don’t hesitate to leave a comment. Thank you so much!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30868cb4f48b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Self, @, @@, <<, [ ] in Ruby]]></title>
            <link>https://yushi95.medium.com/self-in-ruby-5e8a91fa4602?source=rss-bd50029fbd60------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e8a91fa4602</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[object-oriented]]></category>
            <category><![CDATA[self]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[YU SHI]]></dc:creator>
            <pubDate>Wed, 17 Feb 2021 15:04:32 GMT</pubDate>
            <atom:updated>2021-02-23T20:03:40.350Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oc5VXH-sIF6Cmyx9cYsUAw.jpeg" /></figure><p>While learning Ruby programming language you may find the use of “self” very confusing, but it’s important to know how to use “self” in Ruby. Also you will encounter some symbols @, @@, &lt;&lt;, [ ]. You might want to know what all these symbols mean in Ruby.</p><p>In this article, we are going to explore the following things:</p><ul><li>@, @@, &lt;&lt;, [ ]</li><li>Self</li></ul><h4><strong>What is @, @@, &lt;&lt;, [ ]?</strong></h4><p>I am going to use one of the group lab from the bootcamp to explain what the “self” and @, @@, &lt;&lt;, [ ] are in the instance method and class method. Before we dive into self, you should already know how to create classes, class methods, instance methods, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/0*cLG81KkykoC9OK9C" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/0*l0US2ZUlWqLQ1YkJ" /></figure><p>First, let’s see what each of these symbols (@, @@, &lt;&lt;, [ ]) mean in this lab.</p><ul><li>@(@name, @department, @age) is an instance variable of the class, meaning scope the variable to the instance.</li><li>@@(@@all) is a class variable, meaning that @@ variables are in scope of the class and all the instances.</li><li>The &lt;&lt; (@@all &lt;&lt; self) operator is adding all the Manager instances to the result array. Here, we see that the “self” is all the instances of Manager.</li><li>[ ] operator is used here (@@all = [ ]) to set our class variable equal to an empty array. Arrays are for storing lists of data, so we’ll use an array to store our lists of Manager instances.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0DsCW5s9XSlstR_o" /></figure><p>As you can see, all the methods we wrote in the image above worked. When we test the “Manager.all”, it returns an array of all the Manager instances(@name, @department, @age) that have been initialized. The “Manager.all” is able to return an array of all the Manager instances because we have the class method(def self.all) that reads the value of the variable. Again here(self.all), the “self” is the Manager class.</p><blockquote><em>Want to read this story later? </em><a href="http://usejournal.com/app/signup?save_link=https://medium.com/yushi95/self-in-ruby-5e8a91fa4602"><em>Save it in Journal.</em></a></blockquote><p>If we don’t create a class method for Manager class, it will return “NoMethodError”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/0*GT0ZnhZjTjkCUYYB" /></figure><p>If we don’t have “@@all &lt;&lt; self” inside the initialize method, it will return an empty array when we test “Manager.all”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/0*cqp5_exaL4zq7Kr6" /></figure><p>Also we can show you what happens if we remove an instance variable. Let’s say we remove the instance variable “@name = name”. As you can see the result below, the instance variable @name is not there anymore. It’s because @name is not in the scope of the class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/0*J21EZY7jrcuvTUTI" /></figure><p><strong>Who is the “self” in this method?</strong></p><p>The “self” is a Ruby keyword that gives you access to the current object. Everything in Ruby is an object. String(“”), array([ ]), integer(1), range(0..3), and ted(name) are objects. Even classes themselves are objects. Every object has its own identity and data. Ted has its own identity(Manager) and data(“Ted”, “Accounting”, “35”).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/0*GuV6i93KGdaQpXeF" /></figure><p>Here, I am going to show you how to find out who is “self” in each method by using the pry. In the image below, there are an instance method #employees and class method self.all_department.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y0C-bnSXhM1JI73T" /></figure><p>We are going to put the binding.pry inside the instance method #employees to see who is the “self” here. Make sure to put the require ‘pry’ on top of the class. We all don’t like to see errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EebtDtiG-riKjGJm" /></figure><p>Inside the employees method, “self” is the instance of the Manager yu. In this “#employees” instance method, it’s selecting all the employees that the manager oversees.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I-HOqoDo8GDZuSWg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/0*ZlRmX_CL-H_Bl-YV" /></figure><p>Now, we are going to put the binding.pry inside the class method “Manager.all_department” to see who is the self. Self is the Manager. In this method, it returns an array of all the department names that every manager oversees without repetitions. We have to put .uniq in the end of the method because we don’t want repetitions. When you look back to the manager instances, you will see there are two managers in the accounting department.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/0*tPA1omfaitbJ2NOB" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*bU6ly9DJakLf4-et" /></figure><p><strong>Why do we use self?</strong></p><p>We are using “self” because we don’t want to use the class name for each method definition. Self makes our code easier to change if we change the class. And it makes the code less noisy and easy to read. We don’t want to use “manager.all_department” because it’s too long. That’s why we use “self.all_department”.</p><p>Self was hard for me to understand in the beginning, but it was very important to know what “self” is in the method. I hope this article helps everyone understand what self and @, @@, &lt;&lt;, [ ] do in Ruby. If you think I explained something wrong or unclear, please leave a message in the comment.</p><p>📝 Save this story in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e8a91fa4602" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>