<?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 Alena Trushnikova on Medium]]></title>
        <description><![CDATA[Stories by Alena Trushnikova on Medium]]></description>
        <link>https://medium.com/@alenatrushnikova?source=rss-ee7990f4629a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hFWlEmSIqYluUALsLwITiQ.png</url>
            <title>Stories by Alena Trushnikova on Medium</title>
            <link>https://medium.com/@alenatrushnikova?source=rss-ee7990f4629a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 22:48:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alenatrushnikova/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[Collaborating with Git 201]]></title>
            <link>https://alenatrushnikova.medium.com/collaborating-with-git-201-6d3682c78bf6?source=rss-ee7990f4629a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d3682c78bf6</guid>
            <category><![CDATA[git-rebase]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[git-merge]]></category>
            <category><![CDATA[git-stash]]></category>
            <category><![CDATA[git-cherry-pick]]></category>
            <dc:creator><![CDATA[Alena Trushnikova]]></dc:creator>
            <pubDate>Fri, 12 Mar 2021 22:13:20 GMT</pubDate>
            <atom:updated>2021-03-12T22:13:20.700Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="git logo" src="https://cdn-images-1.medium.com/max/400/1*QaHu8p147Xh6gVpePc-EQQ.jpeg" /><figcaption>Git (<a href="https://2.bp.blogspot.com/-peQpWmIWRcI/XNZ1UfQ8RlI/AAAAAAAAN9k/TZZb3Fhb-pAoqyZ0SZjzPegRPnqOdgfhACEwYBhgL/s400/Git%2BStarted%2Bwith%2BGithub%2Bby%2BJason%2BTaylor.png">source</a>)</figcaption></figure><p>In this post, I’m going to review the git commands that will make your workflow with git more advanced and efficient.</p><p>This post has the following structure:</p><ol><li><a href="#60f8">git cherry-pick</a></li><li><a href="#768c">git stash</a></li><li><a href="#e6da">git merge vs </a><a href="#e6da">git rebase</a></li></ol><p>The basics of collaboration with Git and GitHub could be found in this post:</p><p><a href="https://alenatrushnikova.medium.com/collaborating-with-git-and-github-101-73a3be6738f">Collaborating with Git and  GitHub 101</a></p><h3>git-rebase — Reapply commits on top of another base tip</h3><p>Git cherry-pick 🍒</p><p>git cherry-pick is a powerful command that enables arbitrary Git commits to be picked by reference and appended to the current working HEAD.</p><blockquote>Cherry picking is the act of picking a commit from a branch and applying it to another.</blockquote><h4>When to use git cherry-pick</h4><ol><li><strong>For</strong> <strong>undoing changes and restoring lost commits</strong>. For example, say a commit is accidentally made to the wrong branch. You can switch to the correct branch and cherry-pick the commit to where it should belong.</li><li><strong>For team collaboration</strong>. For example, you know the exact change in the exact commit on your partner’s branch you need to grab to continue working on your feature.</li><li><strong>For bug hotfixes</strong>. For an example scenario, say a developer has started work on a new feature. During that new feature development, they identify a pre-existing bug. The developer creates an explicit commit patching this bug. This new patch commit can be cherry-picked directly to the master branch to fix the bug before it affects more users.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sj3NUGLRIM7lith6QmhcTQ.jpeg" /></figure><h4>Git cherry-pick<strong> usage</strong></h4><pre>$ git checkout feature-branch<br>$ git cherry-pick xx007</pre><p>Cherry-picking is a powerful and convenient command that is incredibly useful in a few scenarios. Cherry-picking should not be misused in place of git merge or git rebase. The git log command is required to help find commits to cherry-pick.</p><h3>Git Stash 📦</h3><p>git stash temporarily shelves (or <em>stashes</em>) changes you&#39;ve made to your working copy so you can work on something else, and then come back and re-apply them later on. Stashing is handy if you need to quickly switch context and work on something else, but you&#39;re mid-way through a code change and aren&#39;t quite ready to commit.</p><blockquote>The git stash command takes your uncommitted changes (both staged and unstaged), saves them away for later use, and then reverts them from your working copy.</blockquote><p>git stash options</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*pHji2tUhXxJOZgqDwNXtHA.png" /><figcaption>git stash options by <a href="https://www.atlassian.com/git/tutorials/saving-changes/git-stash">Atlassian</a></figcaption></figure><h4>Git stash usage</h4><p>1. Pulling from upstream</p><pre>$ git pull # fail<br>$ git stash<br>$ git pull # success<br>$ git stash pop # success</pre><p>2. Switching branches</p><pre>$ git stash<br>$ git checkout very-old-release # fail<br># do something<br>$ git stash pop</pre><h3>Git merge vs. Git rebase 🔁🔀🔂</h3><p>The git merge command lets you take the independent lines of development created by git branch and integrate them into a single branch.</p><p>An example of git merge: merging the main branch into feature branch, and possible visualisation:</p><pre>$ git checkout feature<br>$ git merge main</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tqoaSdrXmtMjredqqBpU5g.jpeg" /></figure><p>The git rebase command allows you to reapply commits on top of another base tip. Rebasing is the process of moving or combining a sequence of commits to a new base commit.</p><blockquote><strong>The golden rule</strong> of the<em>git rebase</em> command is to <strong>never use</strong> it on <strong>public </strong>branches.</blockquote><p>An example of git rebase: rebasing the feature branch onto main branch, and possible visualisation:</p><pre>$ git checkout main<br>$ git rebase feature</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rXnPBdl61l5aKsilRmIktQ.jpeg" /></figure><p>The first thing to understand about git rebase is that it solves the same problem as git merge. Both of these commands are designed to integrate changes from one branch into another branch—they just do it in very different ways.</p><h3>Pros and cons of git merge and git rebase</h3><h4>git merge</h4><p>✅ Easy to find related commits<br>✅ Easy to revert<br>✅ Only solve conflicts once<br>❗️ Merge commit difficult to review<br>❗️ The individual commits not always representative</p><h4>git rebase</h4><p>✅ Keeps history linear and tidy<br>✅ Not trivial to revert<br>❗️ Sometimes multiple conflict resolutions required<br>❗️ No hidden changes<br>✅ Conflicts resolved exactly where they occur</p><p>For more details:</p><p><a href="https://www.atlassian.com/git/tutorials/cherry-pick">https://www.atlassian.com/git/tutorials/cherry-pick</a></p><p><a href="https://www.atlassian.com/git/tutorials/saving-changes/git-stash">https://www.atlassian.com/git/tutorials/saving-changes/git-stash</a></p><p><a href="https://www.atlassian.com/git/tutorials/merging-vs-rebasing">Merging vs. Rebasing | Atlassian Git Tutorial</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d3682c78bf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Components in React]]></title>
            <link>https://medium.com/geekculture/components-in-react-7f447263a8e6?source=rss-ee7990f4629a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f447263a8e6</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-components]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[components]]></category>
            <dc:creator><![CDATA[Alena Trushnikova]]></dc:creator>
            <pubDate>Fri, 12 Mar 2021 22:08:07 GMT</pubDate>
            <atom:updated>2021-03-16T07:44:07.006Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*jJveX8kmQj8cZhvR367wpw.png" /></figure><p>React components are independent and reusable bits of code. A React component takes an optional input and returns a <em>React element</em> which is rendered on the screen.</p><p>There are two main types of React components:</p><ol><li>Functional Components are stateless.</li><li>Class Components are stateful.</li></ol><h3>Functional Components</h3><blockquote>A functional component is just a plain javascript function that <strong>takes props as an argument</strong> and returns a react element. Functional components do not require data from other components and <strong>don’t interact with any other components</strong>.</blockquote><p>What Functional Components CAN do:</p><ol><li>Accept and use props</li><li>Display data in some form (return a react element)</li></ol><p>What Functional Components CAN NOT do:</p><ol><li>Use this.state</li><li>Use lifecycle methods (e.g. componentDidmount).</li><li>Use render method</li></ol><p>An example of a functional component:</p><pre>import React from &quot;react&quot;<br><br>const Welcome = props =&gt; {<br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Hello, {props.name}&lt;/h1&gt;<br>    &lt;/div&gt;<br>  )<br>}</pre><pre><br>export default Welcome </pre><h3>Class Components</h3><blockquote>These components are created using ES6’s class syntax. They have some additional features such as the ability to contain logic (for example methods that handle onClick events), local state (more on this in the next chapter) and other capabilities to be explored in later sections of the book.</blockquote><p>What Class Components CAN do:</p><ol><li>Make use of ES6 class and extend the Component class in React</li><li>Use this.state</li><li>Use lifecycle methods (e.g. componentDidmount).</li><li>Use render method</li><li>Accept pass props and access them with this.props</li></ol><p>An example of a class component:</p><pre>import React, {Component} from &quot;react&quot;<br><br>class Welcome extends Component {<br>  render() {<br>    return (<br>      &lt;div&gt;<br>        &lt;h1&gt;Hello, {this.props.name}&lt;/h1&gt;<br>      &lt;/div&gt;<br>    )<br>  }<br>}</pre><pre>export default Welcome</pre><h3>Which component type to use?</h3><p><strong>Always</strong> use a functional component unless you need to:</p><ol><li>Manage state</li><li>Add lifecycle methods to the component</li><li>Add logic for event handlers</li></ol><p>However, there is another approach to differentiate components based on behavior logic.</p><h3>Presentational Components</h3><p>The presentational component is often called a stateless functional component that takes props and renders UI. Same as a functional component, a presentational component can’t:</p><ol><li>Use this.state</li><li>Use lifecycle methods (e.g. componentDidmount).</li><li>Use render method</li></ol><p>An example of a presentational component:</p><pre><strong>import</strong> React from &#39;react&#39;<br><br><strong>const</strong> Book <strong>=</strong> ({ title, img_url }) <strong>=&gt;</strong> (<br>  <strong>&lt;</strong>div className<strong>=</strong>&quot;book&quot;<strong>&gt;</strong><br>    <strong>&lt;</strong>img src<strong>=</strong>{ img_url } alt<strong>=</strong>{title}/&gt;<br>    <strong>&lt;</strong>h3<strong>&gt;</strong>{ title }<strong>&lt;</strong>/h3&gt;<br>  <strong>&lt;</strong>/div&gt;<br>)<br><br><strong>export</strong> <strong>default</strong> Book</pre><h3>Container Components</h3><p>Container components will deal with the behavioral part. A container component tells the presentational component what should be rendered using props. It shouldn’t contain limited DOM markups and styles. If you’re using Redux, a container component contains the code that dispatches an action to a store. Alternatively, this is the place where you should place your API calls and store the result into the component’s state.</p><p>Here’s a concise definition of the container component pattern:</p><ul><li>Container components are primarily concerned with <em>how things work</em></li><li>They rarely have any HTML markup of their own, aside from a wrapping &lt;div&gt;</li><li>They are often stateful</li><li>They are responsible for providing data and behavior to their children (usually presentational components).</li></ul><p>An example of a container component:</p><pre><strong>class</strong> BookList <strong>extends</strong> Component {<br>  constructor(props) {<br>    <strong>super</strong>(props);<br><br>    <strong>this</strong>.state <strong>=</strong> {<br>      books: []<br>    };<br>  }<br><br>  componentDidMount() {<br>    fetch(&#39;https://learn-co-curriculum.github.io/books-json-example-api/books.json&#39;)<br>      .then(response <strong>=&gt;</strong> response.json())<br>      .then(bookData <strong>=&gt;</strong> <strong>this</strong>.setState({ books: bookData.books }))<br>  }<br><br>  renderBooks <strong>=</strong> () <strong>=&gt;</strong> {<br>    <strong>return</strong> <strong>this</strong>.state.books.map(book <strong>=&gt;</strong> {<br>      <strong>return</strong> (<br>        <strong>&lt;</strong>div className<strong>=</strong>&quot;book&quot;<strong>&gt;</strong><br>          <strong>&lt;</strong>img src<strong>=</strong>{ book.img_url } /&gt;<br>          <strong>&lt;</strong>h3<strong>&gt;</strong>{ book.title }<strong>&lt;</strong>/h3&gt;<br>        <strong>&lt;</strong>/div&gt;<br>      )<br>    })<br>  }<br><br>  render() {<br>    <strong>return</strong> (<br>      <strong>&lt;</strong>div className<strong>=</strong>&quot;book-list&quot;<strong>&gt;</strong><br>        { <strong>this</strong>.renderBooks() }<br>      <strong>&lt;</strong>/div&gt;<br>    )<br>  }<br>}</pre><blockquote>The main thing to keep in mind here is that container components and presentational components go together. In fact, you can think of them as part of the same design pattern. Where presentational components don’t manage state, container components do. Where presentation components are usually subordinate “children” in a component hierarchy, container components are in almost every case the “parents” of presentational components.</blockquote><h3>PureComponent</h3><blockquote>Pure components are primarily used to provide optimizations. They are the simplest and fastest components we can write. They do not depend or modify the state of variables outside its scope. Hence, why pure components can replace simple functional components.</blockquote><p>But, one major difference between a regular React.Component and a React.PureComponent is that pure components perform <strong><em>shallow comparisons</em></strong> on state change. Pure components take care of shouldComponentUpdate() by itself. If the previous state and/or props are the same as the next, the component is not re-rendered.</p><p>React.PureComponent is used for optimizing performance, and there is no reason why you should consider using it unless you encounter some sort of performance issue.</p><pre>import React from ‘react</pre><pre><strong>class</strong> Welcome extends React.PureComponent{<br>  render(){<br>    <strong>return</strong> (<br>      &lt;div&gt;<br>        &lt;h1&gt;Welcome!&lt;/h1&gt;<br>      &lt;/div&gt;<br>    )<br>  }<br>}</pre><pre>export default Welcome</pre><p>Finally, always think about component roles in the App before going with any type.</p><p><a href="https://learn.co/lessons/react-container-components">React Container Components - Learn.co</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f447263a8e6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/components-in-react-7f447263a8e6">Components in React</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[Collaborating with Git and  GitHub 101]]></title>
            <link>https://alenatrushnikova.medium.com/collaborating-with-git-and-github-101-73a3be6738f?source=rss-ee7990f4629a------2</link>
            <guid isPermaLink="false">https://medium.com/p/73a3be6738f</guid>
            <category><![CDATA[collaboration]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[pull-request]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Alena Trushnikova]]></dc:creator>
            <pubDate>Fri, 26 Feb 2021 18:13:53 GMT</pubDate>
            <atom:updated>2021-03-11T18:27:44.369Z</atom:updated>
            <content:encoded><![CDATA[<h3>Collaborating with Git and GitHub 101</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*jpolgNzpJnrqk9ntwlqDnw.png" /><figcaption>Git and Git Hub by <a href="https://d1jnx9ba8s6j9r.cloudfront.net/blog/wp-content/uploads/2017/12/gitHub-528x286.png">Edureka</a></figcaption></figure><p>In this post, I’m going to look at how to collaborate with the team using Git if you are all beginners. I’ll show how to synchronize with a remote repository, use branches, and make pull requests. And then I’ll give an example of workflow a team may use for working on the project.</p><p>This post has the following structure:</p><ol><li><a href="#2b65">Syncing with a Remote Git Repository</a></li></ol><ul><li><a href="#7fea">git remote</a></li><li><a href="#bf59">git clone</a></li><li><a href="#7452">git fetch</a></li><li><a href="#1e8e">git pull</a></li><li><a href="#56a0">git push</a></li></ul><p>2. <a href="#0b43">Working with Branches</a></p><ul><li><a href="#396b">git branch</a></li><li><a href="#2409">git checkout</a></li><li><a href="#ae9e">git merge</a></li></ul><p>3. <a href="#8581">Making a Pull Request</a></p><p>4. <a href="#88e9">Example</a></p><p>Before we go into the details let define the difference between git vs GitHub:</p><ol><li><strong>git is a local VCS software</strong> that enables developers to save snapshots of their projects over time. It’s generally best for individual use.</li><li><strong>GitHub is a web-based platform that incorporates git’s version control features</strong> so they can be used collaboratively. It also includes project and team management features, as well as opportunities for networking and social coding.</li></ol><h3>Syncing with a Remote Git Repository</h3><h4><strong>Git remote</strong></h4><p>The git remote command is responsible for <em>creating, viewing, and deleting</em> connections between remote and local repositories.</p><blockquote>Hint! Remote connections are more like bookmarks rather than direct links into remote repositories.</blockquote><p><strong>Common </strong><strong>git remote commands</strong></p><ul><li>git remote -v: List the current remotes associated with the local repository including the URL of each remote repository</li><li>git remote add [name] [URL]: Create a new connection to a remote repository</li><li>git remote remove [name]: Remove the connection to the remote repository</li></ul><h4>Communicating with a remote Git repo</h4><p>There are four commands within Git that prompt communication with the remote.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l3BiOKu2Sy0BwLIxKM8cjw.jpeg" /></figure><p><strong>1. Git clone</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eQuCvxEFlsETcYe3rgaSWw.jpeg" /></figure><p>The git clone command creates a copy of an existing Git repository, including all of the files, branches, and commits. git clone involves cloning the entire repository, and setting its HEAD to the latest commit in the main branch.</p><blockquote>Hint! If any changes added to the original repo after you <em>git clone </em>it, they won’t be available to your copy of original repo until you run<em>git fetch</em> or <em>git pull.</em></blockquote><p><strong>Common </strong><strong>git clone commands</strong></p><ul><li>git clone username@host:path/to/repository: Create a working copy of a <strong>remote </strong>repository</li><li>git clone /path/to/repository: Create a working copy of a <strong>local</strong> repository</li></ul><p><strong>2. Git fetch</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4nxuA04LDMMzbSjcWG3x1A.jpeg" /><figcaption>git fetch gives access to the entire branch structure of other repo</figcaption></figure><p>The git fetch command downloads commits, files, and refs from a remote repository into your local repo. Fetching is what you do when you want to see what everybody else has been working on.</p><blockquote>Hint! git fetch<em> </em>doesn’t integrate any of this new data into your working files.<em> </em>git fetch will never manipulate, destroy, or screw up anything.</blockquote><p><strong>Common </strong><strong>git fetch commands</strong></p><ul><li>git fetch &lt;remote&gt;: Fetch all of the branches from the repository</li><li>git fetch &lt;remote&gt; &lt;branch&gt;: Same as the above command, but only fetch the specified branch</li></ul><p><strong>3. Git pull</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DdajSf6y_cLdaDHKKL7VLg.jpeg" /></figure><p>The git pull command is used to fetch and download content from a remote repository and <em>immediately update</em> the local repository to match that content.</p><blockquote>Hint! git pull is used with a different goal in mind: to update your current HEAD branch with the latest changes from the remote server.</blockquote><p><strong>Common </strong><strong>git pull command</strong></p><ul><li>git pull &lt;remote&gt;: Fetch and merge changes on the remote server to the local working directory. This is the same as git fetch followed by git merge.</li></ul><p><strong>4. Git push</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kvnx9XRNwDpwA-Z0j7fFIA.jpeg" /></figure><p>The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote.</p><p><strong>Common </strong><strong>git push commands</strong></p><ul><li>git push &lt;remote&gt; &lt;branch&gt;: Push the local branch to the specified remote repository. Creates (if it doesn’t exist) or updates a local branch in the remote repository</li><li>git push &lt;remote&gt; -all: Push all local branches to the specified remote repository. Creates (if they don’t exist) or updates all local branches in the remote repository</li></ul><h3>Working with Branches</h3><p>A branch represents an independent line of development. Branches serve as an abstraction for the edit/stage/commit process. In Git, branches are a part of your everyday development process. Git branches are effectively a pointer to a snapshot of your changes. When you want to add a new feature or fix a bug — no matter how big or how small — you spawn a new branch to encapsulate your changes. This makes it harder for unstable code to get merged into the main code base, and it gives you the chance to clean up your future’s history before merging it into the main branch.</p><p><strong>1. Git branch</strong></p><p>The git branch command lists all the branches in the repository and shows what branch you’re currently in</p><p><strong>Common </strong><strong>git branch commands</strong></p><ul><li>git branch: List existing branches in your repository; the current branch will be highlighted in green and marked with an asterisk</li><li>git branch -d/-D &lt;branchname&gt;: Delete the specified branch/Force delete the specified branch, even if it has unmerged changes</li><li>git branch -m &lt;newbranchname&gt;: Rename the current branch to &lt;newbranchname&gt;</li><li>git branch -a: List all remote branches</li></ul><p><strong>2. Git checkout</strong></p><p>The git checkout command lets you navigate between the branches.</p><p><strong>Common </strong><strong>git checkout commands</strong></p><ul><li>git checkout &lt;branchname&gt;: Switch from one branch to another</li><li>git checkout -b &lt;branchname&gt;: Create a new branch and switch to it</li></ul><blockquote>Hint! The git checkout command may occasionally be confused with git clone. The difference between the two commands is that clone works to fetch code from a remote repository, alternatively checkout works to switch between versions of code already on the local system.</blockquote><p><strong>3. Git merge</strong></p><p>The git merge command lets you take the independent lines of development created by git branch and integrate them into a single branch. Git merge will combine multiple sequences of commits into one unified history. In the most frequent use cases, git merge is used to combine two branches.</p><blockquote>Hint! Note that all of the commands presented below merge into the current branch. The current branch will be updated to reflect the merge, but the target branch will be completely unaffected.</blockquote><p><strong>Common </strong><strong>git merge commands</strong></p><ul><li>git merge &lt;branchname&gt;: Merge a different branch into the current branch</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oGnyzXvrwx5q5SuAMu6CQw.jpeg" /></figure><h3>Making a Pull Request</h3><p>Pull requests are a feature that makes it easier for developers to collaborate using GitHub. They provide a user-friendly web interface for discussing proposed changes before integrating them into the official project. The general process of using pull-requests is as follows:</p><ol><li>A developer creates the feature in a dedicated branch in their local repo.</li><li>The developer pushes the branch to a GitHub repository.</li><li>The developer files a pull request via GitHub.</li><li>The rest of the team reviews the code, discusses it, and alters it.</li><li>The project maintainer merges the feature into the official repository and closes the pull request.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h31uQMHpsT7_6ZOeEehAwQ.png" /><figcaption><a href="https://www.atlassian.com/blog/bitbucket/5-pull-request-must-haves">https://www.atlassian.com/blog/bitbucket/5-pull-request-must-haves</a></figcaption></figure><h3>Example</h3><p>The example below demonstrates how pull requests can be used in the Feature Branch Workflow. The Feature Branch Workflow assumes a central repository and main represents the official project history. Instead of committing directly to their local main branch, developers create a new branch every time they start work on a new feature.</p><p>In the example, James is a developer, and Mia is the project maintainer. main branch of Mia’s GitHub repository represents the official project history.</p><blockquote>Hint! To protect main branch from direct <em>git push</em> made by other’s developers, Mia protects her <em>main</em> branch.</blockquote><p>To protect your main branch from direct pushes by other project’s collaborators go to <strong>Settings</strong> of GitHub repository, select <strong>Branches</strong> in the menu on the left side, and click <strong>Add rule</strong> in the ‘Branch protection rules’ section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H8eOYpY9UNurjskVjA10cg.png" /></figure><p>In order to protect main branch, put main in the ‘branch name pattern’ box. And the select “<strong>Require pull request reviews before merging”. </strong>Now all commits must be made to a non-protected branch and submitted via a pull request with the required number of approving reviews and no changes requested before it can be merged into a branch that matches this rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VK21snEI0QYqo15z0mECAw.png" /></figure><h4>James clones Mia’s GitHub repository</h4><p>James needs to clone the GitHub repository. This will give him a working copy of the project on his local machine. He can do this by running the following command:</p><pre>git clone <a href="https://github.com/facebook/react.git">https://github.com/user/repo.gi</a>t</pre><h4>James develops a new feature</h4><p>Before he starts writing any code, James needs to create a new branch for the feature. This branch is what she will use as the source branch of the pull request.</p><blockquote>Hint! <strong>Use name of the feature for branch name</strong>. In this case your team will know what changes are included in this branch. Avoid using your name, date or other unrelated and unclear namigs.</blockquote><pre>#create a new branch for a new feature<br>git checkout -b new-feature<br>#edit some files, add and commit changes<br>git add &lt;file&gt; #if you want to add by file <br>git commit -m &#39;First commit&#39; #include change description<br>#edit more files<br>git add . #if you want to add all changed files<br>git commit -m &#39;Finished feature&#39;</pre><h4>James pushes the feature to Mia’s GitHub repository</h4><p>After his feature is complete, James pushes the feature branch to <strong>Mia’s GitHub repository</strong> with a simple git push:</p><pre>git push origin some-branch</pre><p>This makes his changes available to the project maintainer (or any collaborators who might need access to them).</p><h4>James creates the pull request</h4><ol><li>James goes to <strong>Mia’s GitHub repository </strong>and creates a pull request.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*cDUjpdXDBf3Ult2INGtOew.gif" /></figure><p>2. In the <strong>Example Comparisons</strong> box, select the branch he made, readme-edits, to compare with main (the original).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQ9qZi9nDrxwogi4HgsBrQ.png" /></figure><p>3. James looks over his changes in the diffs on the Compare page, makes sure they’re what he wants to submit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*9jMKNG83Txc_4Nn6U-IG0A.png" /></figure><p>4. When James is satisfied that these are the changes he wants to submit, he clicks the big green <strong>Create Pull Request</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5mWR6EaQcVf4nbvmvmtjTQ.png" /></figure><p>5. If there are no conflicts, Mia can merge James’s pull request. If there would be any conflicts or comments from Mia regarding James’s changes, they should discuss them before the merge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y24Lu9giGsPPOtbzs-nbhg.png" /></figure><p>In the example above, both James and Mia could work on their features independently and then discuss their changes through a pull request. At the same time main branch of Mia’s GitHub repository represents the official project history and it’s protected from any direct changes by other project’s collaborators.</p><h4><em>Learn more about Git commands:</em></h4><p><a href="https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet">Git cheat sheet | Atlassian Git Tutorial</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73a3be6738f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I switched from Visual Studio Code to RubyMine.]]></title>
            <link>https://alenatrushnikova.medium.com/why-i-switched-from-visual-studio-code-to-rubymine-60ffe746b1a6?source=rss-ee7990f4629a------2</link>
            <guid isPermaLink="false">https://medium.com/p/60ffe746b1a6</guid>
            <category><![CDATA[rubymine]]></category>
            <category><![CDATA[visual-studio-code]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Alena Trushnikova]]></dc:creator>
            <pubDate>Fri, 15 Jan 2021 01:09:01 GMT</pubDate>
            <atom:updated>2021-01-15T01:09:01.010Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*rMeSl3r04zIhFK6Zg9uZFQ.jpeg" /></figure><p>Choosing a development environment that fits you can be hard whether you are a professional developer or only starting your journey. In this post, I will highlight the main differences between text editors and IDEs, and why I switched from Visual Studio Code to Rubymine.</p><h3><strong>Text editors</strong></h3><p>In this case, we will refer to <strong>programming text editors</strong> that are made for writing code. A text editor allows to create and edit a range of programming language files.</p><p><strong>Typical features:</strong></p><ol><li>Find and replace.</li><li>Cut-copy-paste.</li><li>Text formatting.</li><li>Undo/redo.</li></ol><p><strong>Advanced features:</strong></p><ol><li><strong>Syntax highlighting</strong>. A text editor may highlight source code, markup languages, config files, etc.</li><li><strong>Folding</strong>. Collapse/expand a section of the text from view.</li><li><strong>Extensibility</strong>. Using plugins allows developers to customize the editor for their individual needs.</li></ol><blockquote>The main drawback of using Visual Studio Code for me was the fact that you always have to search for the plugins, set up them, and hope that they are working the way you want them to work.</blockquote><h3><strong>Integrated Development Environment (IDE)</strong></h3><p><strong>IDE</strong> is a software application that typically consists of not only a text editor but also includes build automation tools and a debugger.</p><p><strong>Features:</strong></p><ol><li><strong>Automatic code completion</strong>. IDE suggests a list of matching variables, methods, and keywords while the developer types his code, including methods within the project.</li><li><strong>Version control system</strong>. Most IDEs support major VCSs and allow tracking changes in the source code, working with branches, or, for example, commit, push or creating pull requests within an IDE.</li><li><strong>Testing and debugging</strong>. Some IDEs allow generating tests from templates as well as having an interactive debug console.</li><li><strong>Navigation and search </strong>through the project. IDE allows easily navigate to the methods, tests, etc, or find the places that use a class, method, variable, or symbol.</li></ol><blockquote>After I started using RubyMine as my main development environment, I don’t need to look for plugins, checking if they are reliable. The only thing I did — added shell script for launching Rubymine from the command line.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*QdyorJ1M844Rfk6BY4O8VQ.png" /></figure><h3>What I enjoy in using RubyMine most</h3><p>Let&#39;s check how the features of RubyMine makes you faster and more productive.</p><ol><li><strong>Automatic code completion. </strong>It works as you type, suggesting a list of matching variables, methods, and keywords. In RubyMine, completion works for <em>Ruby and Rails, JavaScript and CoffeeScript, ERB, HAML, CSS, and Sass.</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*Am3N-Ybq_YjTIXfCrQbagA.gif" /></figure><p>2. <strong>Version control system.</strong> RubyMine works with Git and GitHub, Mercurial, Subversion, Perforce, and others from the IDE. Check how easy to add, commit, and push changes on GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*zQA4j2WETi4BNdP9F07mPQ.gif" /></figure><p>3. <strong>Navigate and search through the project.</strong> Quickly identify how everything works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*yCVGO5wnfUU4j2Ps_x_94A.gif" /></figure><p>4. <strong>Ruby on Rails</strong>. RubyMine helps to add new Rails entities, such as models, controllers, and migrations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*uixDvJVIhd-BzftOp5P6OQ.gif" /></figure><p>In this post, I showed only a couple of examples of how IDE makes the coding process more efficient and pleasant.</p><p><strong>To open the project in RubyMine from the command-line follow the </strong><a href="https://www.jetbrains.com/help/ruby/working-with-the-ide-features-from-command-line.html"><strong>instructions</strong></a><strong>.</strong></p><p>Here’s an example of my process of setting the command-line interface for RubyMine.</p><p>First thing, we need to create a ‘rubymine’ script in the ‘bin’ folder.</p><pre>$ cd /usr/local/bin</pre><p>Here you’ll see a list of shell scripts</p><pre>$ ls</pre><p>Let’s create a &#39;rubymine&#39; shell script</p><pre>$ vim rubymine</pre><p>And add the following</p><pre>#!/bin/sh</pre><pre>open -na “RubyMine.app” — args “$@”</pre><p>Then I tried to open my project from the command line, but got the following:</p><pre>$ cd /my_project<br>$ rubymine .</pre><pre>zsh: permission denied: rubymine</pre><p>If you get a &#39;permission denied&#39; message run the following command:</p><pre>$ sudo chmod -R 777 /usr/local/bin/rubymine</pre><p>Try to open it in RubyMine again:</p><pre>$ rubymine .</pre><p><strong><em>Learn more about features and switch to </em></strong><a href="https://www.jetbrains.com/ruby/"><strong><em>RubyMine</em></strong></a><strong><em> today! Happy coding!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60ffe746b1a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[But First, Let’s Draw! UML Diagrams are for Everyone.]]></title>
            <link>https://alenatrushnikova.medium.com/but-first-lets-draw-uml-diagrams-are-for-everyone-8cbb71b206fa?source=rss-ee7990f4629a------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cbb71b206fa</guid>
            <category><![CDATA[uml]]></category>
            <category><![CDATA[class-diagram]]></category>
            <category><![CDATA[relationships]]></category>
            <category><![CDATA[class]]></category>
            <category><![CDATA[miro]]></category>
            <dc:creator><![CDATA[Alena Trushnikova]]></dc:creator>
            <pubDate>Thu, 24 Dec 2020 01:42:14 GMT</pubDate>
            <atom:updated>2021-01-14T17:53:18.264Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A quick guide on how to visualize your project.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*g3kaJoI4p6kvsSD9qmFLcg.jpeg" /><figcaption>Software Engineer Drawing A Uml Class Diagram by <a href="https://500px.com/nullplus">Razvan Chisu</a> on <a href="https://500px.com/photo/218211183/Software-Engineer-Drawing-A-Uml-Class-Diagram-by-Razvan-Chisu">500px</a></figcaption></figure><h3>UML and UML diagram</h3><p><strong>UML</strong> (or Unified Modeling Language) is there to provide a standard way to show <strong>system design</strong>. Nowadays this language is used to model not only software solutions, but also application structures, system behavior, and business processes.</p><p><strong>UML diagrams</strong> help to <strong>visually represent</strong> data by dividing a complex software system into components and subcomponents.</p><h3>Reasons to start using UML diagrams</h3><p>Think about some of the <strong>benefits</strong> you get from using UML diagrams:</p><ol><li><strong>Visual Representation</strong></li></ol><p>A UML diagram allows you to easily <strong>view the relationships</strong> and navigate between objects in your system.</p><p><strong>2. Standard</strong></p><p>Because UML is <strong>widely understood</strong> and well known, this makes it easy for a new team member to step into a project and be productive from day one.</p><p><strong>3. Planning Tool</strong></p><p>UML helps to <strong>plan a program or new features</strong> before the development takes place.</p><p><strong>4. Collaboration</strong></p><p>Having a visualization of the system design makes<strong> communication</strong> with technical and non-technical audiences <strong>easier.</strong></p><p>Try to use UML diagrams even for your pet-project to see a whole well-structured picture, to plan features, and share your project design with others.</p><h3>Types of UML diagrams</h3><p>Just for your reference, there are 14 different types of UML diagrams, and you can find the classification in the picture below. As for now, The most popular types are the following:</p><ol><li><strong>Class Diagram. </strong>Examples: <em>Domain model diagram, Android Camera implementation classes.</em></li><li><strong>Activity Diagram. </strong>Examples:<em> Online Shopping, Single Sign-On for Google Apps.</em></li><li><strong>Use Case Diagram. </strong>Examples: <em>Airport check-in and security screening business model, Point of sales (POS) terminal.</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ySudVc8QoJQQghkliobCHw.jpeg" /><figcaption>UML Diagram Types on <a href="https://www.process.st/uml-tutorial/">process.street</a></figcaption></figure><p>If you want to learn more about each type of UML diagram, you can find detailed information here <a href="https://www.uml-diagrams.org/uml-25-diagrams.html">https://www.uml-diagrams.org/uml-25-diagrams.html</a></p><h3>How to start drawing UML diagrams</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*BUI0EUCzUa1lOAs2" /><figcaption>UML is love, UML is life on <a href="https://www.reddit.com/r/ProgrammerHumor/comments/b3okry/uml_is_love_uml_is_life/">Reddit</a></figcaption></figure><p>As you might have noticed by now, using a UML diagram for documenting processes and systems can be very beneficial. The downside is that it can seem <strong>complex at first to draw one</strong>. You gotta learn the syntax, and you need to choose which diagram out of the 14 different types is the most efficient for the job, etc.</p><p>Just like any other thing in life, to get something done properly, you need the <strong>right tools and practice</strong>. For documenting software, processes, or systems, you need the <strong>tools that offer UML annotations and UML diagram templates</strong>. Different software documentation tools can help you draw a UML diagram (however, paper and pencil are always there for you). Here is a shortlist of a few <strong>software tools for drawing UML diagram</strong>s:</p><ul><li><a href="https://www.draw.io/">Draw.io</a></li><li><a href="https://www.lucidchart.com/">Lucidchar</a></li><li><a href="https://www.gliffy.com/">Gliffy</a></li><li><a href="http://miro.com/">Miro</a></li><li><a href="https://products.office.com/en/visio/flowchart-software">Microsoft Visio</a></li></ul><h3>Build your own UML diagram right now</h3><p>You may think that to build your own UML diagram you need to study all specification documents and it’s very complicated. But the complexity depends on your project and goals.</p><p>Let’s create a simple example of a UML class diagram. I will work with Miro as an online whiteboard, Miro is designed to help brainstorm and get ideas off the ground.</p><ol><li>To start with, go to <a href="https://miro.com/">miro.com</a> and create your account.</li><li>Add <a href="https://miro.com/templates/uml-diagram/">UML Diagram template</a> to your boards by clicking “use template”.</li><li>Start creating your first UML diagram. Note! The only chart currently supported in Miro is a Class Diagram.</li><li>Don’t forget to share your ideas and collaborate with others, Miro’s whiteboard tool is perfect for this.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*brCxTDEo6KqtzOiv" /><figcaption>Photo by <a href="https://unsplash.com/@_alikokab_?utm_source=medium&amp;utm_medium=referral">Ali Kokab</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I will use Superheros as my domain with three models: Hero, Power, and Movie. Movies can have multiple Heroes. Each Hero can appear in multiple Movies. Each Hero can have multiple Powers. Powers can belong to multiple Heroes. Only Superman has X-ray power, but both Green Lantern and Silver Surfer can fly. Let’s draw it with UML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rb36BdwDqNYd9o7h" /><figcaption>UML Class Diagram made with <a href="http://miro/">Miro</a></figcaption></figure><p>A UML class diagram is composed of two components: classes and relationships. Classes have three sections:</p><ol><li><strong>Upper section</strong>: Contains <strong>the</strong> <strong>name of the class</strong>.</li><li><strong>Middle section</strong>: Contains <strong>the</strong> <strong>attributes of the class</strong>. Use this section to describe the qualities of the class.</li><li><strong>Bottom section</strong>: Includes <strong>class operations (methods)</strong>. The operations describe how a class interacts with data.</li></ol><p>In this example I created three classes:</p><p><strong>Hero Class</strong></p><p><strong><em>Attributes</em></strong><em>: Name, Super Name, Quote</em></p><p><strong><em>Methods</em></strong><em>: Speak, Use Power</em></p><p><strong>Power Class</strong></p><p><strong><em>Attributes: </em></strong><em>Name, Description, Strength</em></p><p><strong><em>Methods:</em></strong><em> Increase, Decrease</em></p><p><strong>Movies Class</strong></p><p><strong><em>Attributes:</em></strong><em> Name, Release Date, Director</em></p><p><strong><em>Methods:</em></strong><em> Play, Buy</em></p><p>To summarize, UML diagrams are great for visualizing your projects and modeling business processes and workflows. And you can start doing it today with available online software tools.</p><p><em>If you want to learn more about UML diagrams:</em></p><p>UML Diagrams cheat sheet: <a href="https://www.scribd.com/document/37029290/UML-Cheatsheet">https://www.scribd.com/document/37029290/UML-Cheatsheet</a></p><p>UML diagram relationships: <a href="https://creately.com/blog/diagrams/class-diagram-relationships/">https://creately.com/blog/diagrams/class-diagram-relationships/</a></p><p>Detailed information about UML diagrams with cool examples for each type: <a href="https://www.uml-diagrams.org/">https://www.uml-diagrams.org/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cbb71b206fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>