<?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 Vanessa Prema on Medium]]></title>
        <description><![CDATA[Stories by Vanessa Prema on Medium]]></description>
        <link>https://medium.com/@vanessaprema?source=rss-46372379bec0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GCbcNgNQ6IBanJQO5Xq49Q.jpeg</url>
            <title>Stories by Vanessa Prema on Medium</title>
            <link>https://medium.com/@vanessaprema?source=rss-46372379bec0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:02:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vanessaprema/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[Study Like You Mean It]]></title>
            <link>https://medium.com/@vanessaprema/study-like-you-mean-it-4b3fce81ded1?source=rss-46372379bec0------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b3fce81ded1</guid>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Vanessa Prema]]></dc:creator>
            <pubDate>Tue, 19 Feb 2019 15:06:57 GMT</pubDate>
            <atom:updated>2019-02-19T15:06:57.775Z</atom:updated>
            <content:encoded><![CDATA[<h4>confessions from a girl who <strong>loves</strong> to study</h4><p>Recently I had one of classmates approach me about my study habits so I thought it would be fun to share some of the tips I personally use on here. Please feel free to chuck any and all advice out the window if you think it’s absolute rubbish! I am not a professional or anything… just a girl who loves to study.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*UhYsS8B6Xqonv1IN26WUAg.gif" /></figure><p>A little background about me: I got my bachelor’s degree in materials science &amp; engineering from Georgia Tech and am currently a student at Flatiron School studying web development. I first discovered my love for learning at a very young age and frequently visited the library to read the encyclopedia (weird, I know). Whether it’s baking, fashion technology, or ornithology, I just absolutely love learning about random stuff!</p><p>Anyway, here are some tips I hope you find helpful:</p><h3>1. Have a little faith</h3><p>Now I know this is easier said than done but going into any new territory with your head held high is going benefit you greatly. Take a deep breath, have a little faith, and dive in. Being pessimistic and getting discouraged before starting will only make you feel worse and put a bad taste in your mouth. I know it’s cliché but really, truly anyone can learn anything, so don’t let the fear of not knowing ruin your chances of discovering something new and incredible. Believe in yourself, put in the hard work, and the rest <em>will follow</em>!</p><h3>2. Put away your phone</h3><p>But really. Put it away. Not screen-down on the desk. Not on silent. Away, away. In your book bag, in the other room, turned off completely, whatever you need to do. Social media is a disease and it is <a href="https://www.npr.org/programs/ted-radio-hour/614007696/attention-please?showDate=2018-05-25">killing our attention span</a>. The average has gone from 3 minutes to now <em>45 seconds</em> over the last decade. Your productivity is not the same and it’s a fact! This also applies to TV, Reddit, or whatever else you find yourself glued to these days. “Multitasking” while trying to review or learn a new concept is not a real thing, so stop trying to make it happen.</p><p>Side note: listening to music is beneficial only to a certain extent. If it’s too distracting and you find yourself singing along rather than focusing, you gotta change your playlist. Personally, I listen to classical or movie scores (Lord of the Rings is my favorite).</p><h3>3. Come up with a plan</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*3RlpYZCS9Vx1iIfM9DtHOg.gif" /></figure><p>Come up with a study plan with realistic goals. Whether it’s studying for a test or learning a new skill, having a timeline will help you see the whole picture. Start with the end goal and break it up into chunks. At this point however, you should be careful and practical about what you can accomplish within a study session. We would all love to be able to absorb 5 hours of studying in 30 minutes, but it simply is not the case. Buckle down, take away the distractions, and focus on those short term goals one at a time.</p><p>If you’re lost on where to start, try timing yourself! Go through one topic from beginning to end and see how long it takes you. If you find yourself taking too long for your liking, don’t stress. With practice, you will easily shorten this time. Once you get to a comfortable pace, use a timer to get yourself to stop at a certain point.</p><p>Over-doing it can be just as detrimental so be sure to take breaks! Many people implement the <a href="https://en.wikipedia.org/wiki/Pomodoro_Technique">Pomodoro Technique</a>, that involves 25 minutes of studying followed by a 5 minute break. I personally think 25 minutes is too short, so I’ll do 45–60 minutes of studying followed by a 5-10 minute break.</p><h3>4. Diversify</h3><p>In my opinion, there is one truth that is absolutely essential to studying successfully: <strong>diversifying the way you study</strong>. What do I mean by this? Find different ways to reinforce information in your head. Yes, <em>vanilla studying</em> like reading and writing notes will work, but going beyond that to work on practice questions, drawing out flowcharts, or teaching a peer will help tremendously with your level of understanding. Make it fun by adding colored pens and highlighters to the mix! This is giving your mind another avenue or another memory to associate the content you learned.</p><p>For me personally, lecture was something I dreaded in college. I thought it was useless and that I could easily learn that information from my textbook. What I didn’t realize it that I was missing out on another opportunity for my brain to be exposed to that information via an alternative route. By reading before class and then <strong>participating</strong> in lecture, I was able to make even more connections to the concepts I was learning. In summary: repeat, repeat, repeat!</p><h3>5. Study smarter, not harder</h3><p>I know a lot of people say to do this, but I honestly found it hard to do when I first started college so I will try to explain this to the best of my abilities. There is a balance to knowing what to study for an exam, and what to study to make you feel confident about the material you are learning. Sometimes, unfortunately, it takes that first exam to understand how the professor wants you to know something. Try to <em>recognize</em> what types of information are needed to do well on exams. What <em>kind</em> of questions are being asked? <em>How</em> are they being asked? What <em>specific</em> <em>content</em> is being asked upon?</p><p>At the same time, don’t just memorize all of the vocabulary words that you know will be on an exam. Connect the concepts, learn the content, and find different ways to get it into your brain. Memorizing will only temporarily put that stuff in your head and it’s important to keep it long term. Having a solid foundation of the basics is critical when studying any subject!</p><h3>6. Getting stuck</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*StkGwG3cjQsrpvMWAZft4A.gif" /></figure><p>A lot of times you’re going to get stuck and frustrated with difficult concepts. First of all, don’t let yourself get discouraged and don’t give up! Secondly, try <em>every</em> <em>resource</em> you can to try and better understand something. If reading your textbook is not cutting it for you, find another source of information. The World Wide Web is your friend! You can use YouTube, research publications, documentation, or even someone’s post on Medium. If you end up discovering something super interesting, (if time permits) don’t be afraid to dig deep into topics you find fascinating!</p><p>With that being said, try really, really hard to find answers on your own before asking a teacher or a peer. I know it’s tempting, but by changing this habit, you are becoming more self-reliant and creating another avenue of memory. For example, say if I get a bug in my code and I cannot for the life of me fix it. I’ve been staring at my screen for 30 minutes now, and I start searching the internet to find someone else had the same issue. Turns out, all I had was a minor typo and I am so mad that I didn’t notice it sooner. However, now I will never forget that mistake because of how frustrated it made me feel!</p><h3>7. Recall, don’t recognize</h3><p>So you’ve been studying for a while now, how do you know if you’re ready for the test? You need to be able to <em>recall</em> this information, or remember it without looking at any of your resources. <em>Recognizing</em> is the act of seeing something and then being able to remember something about it, but we want the ability to remember without any cues because those memories last much longer.</p><p>My favorite way of practicing this is by making a mock exam. This is a great method because you’re having to go through all of your notes to come up with questions as well as answer the questions as practice! After that, you can see which areas of content you were not able recall and review said concepts. At this point, feel free to grab a few friends and go through content together!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*q22pod3SDLjLzvUeJ6V4Kg.gif" /></figure><p>While it does take time and a conscious effort, I believe anyone is capable of becoming a successful student. I hope this was helpful and informative :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b3fce81ded1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Goin’ In Style (pt 1/2)]]></title>
            <link>https://medium.com/@vanessaprema/goin-in-style-pt-1-2-dfcc27d5dfef?source=rss-46372379bec0------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfcc27d5dfef</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Vanessa Prema]]></dc:creator>
            <pubDate>Tue, 05 Feb 2019 18:30:52 GMT</pubDate>
            <atom:updated>2019-02-18T01:34:53.150Z</atom:updated>
            <content:encoded><![CDATA[<h4>CSS Guide for the Amateur Developer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*AquXa8v0IGKM_-08jn81GQ.gif" /></figure><h4>What is CSS anyway?</h4><p>CSS is a style sheet language that stands for <em>cascading style sheets.</em> It describes how HTML elements will be displayed. This separation of presentation and content, gives programmers the ability to implement real design intent (various styles for different displays).</p><p><strong><em>~ Now let’s get to the good stuff ~</em></strong></p><h3>CSS Syntax</h3><h4>Rule-Set</h4><p>A CSS rule-set consists of a <strong>selector</strong> and a <strong>declaration block</strong>. The selector points to the specific HTML element you want to style. The declaration block is wrapped in {} and can contain more than one <strong>declaration</strong> (each separated by semicolons). Each declaration has a CSS <em>property</em> and a <em>value</em>, separated by a colon.</p><p>For example, if you wanted all of your &lt;h2&gt;<strong> </strong>HTML elements to be <em>purple</em> and <em>centered</em>, it would look something like this:</p><pre>h2 { <br>   color: purple;<br>   text-align: center;<br>}</pre><h4>Selectors</h4><p>Selectors are used to <em>literally</em> <em>select</em> HTML elements based on their element type, id, class name, and many more. All of said selected elements will have the style described in the declaration block.</p><p><strong>Selecting by element</strong> (as seen in the example above) does not require any other specific syntax.</p><p><strong>id selectors</strong> use the id attribute of an HTML element to select a specific element. For this, a hash character (#) is needed before the id name.</p><p>For example, if you had an element with an id name called “doggo-container” where the text needed to be aligned to the <em>left</em> and <em>red</em>:</p><pre>#doggo-container {<br>   color: red; <br>   text-align: left;<br>}</pre><p><strong><em>Keep in mind:</em></strong><em> the id of an element is </em><strong><em>always unique</em></strong><em>, so this selector is used to select one unique element!</em></p><p><strong>class selectors </strong>use the class attribute of an HTML element to select all elements with said class name. For this, a period (.) is needed for the class name.</p><p>For example, if you had an element with a class name called “toy-collection” where the text was <em>blue</em> and aligned to the <em>right</em>:</p><pre>.toy-collection {<br>   color: blue;<br>   text-align: right;<br>}</pre><p><strong><em>Keep in mind:</em></strong><em> an element can have </em><strong><em>multiple classes</em></strong><em>, this comes in handy when you want something to be styled in more than one way.</em></p><h4>Grouping Selectors</h4><p>Sometimes you’re going to have elements that require the same style and rewriting that code would be tedious and redundant… that’s why we can group!</p><p>For example, say you wanted all of your &lt;h1&gt;, &lt;h2&gt;, and &lt;p&gt; elements to be <em>green</em> and <em>center</em> aligned. Instead of writing them out individually, you could simply separate each selector with a comma:</p><pre>h1, h2, p {<br>   color: green;<br>   text-align: center;<br>}</pre><h3>CSS Insertion</h3><p>Wowza, CSS is pretty cool! But where on earth does this code go into your application? There are actually three ways you can insert CSS into code:</p><ol><li>External Style Sheet</li><li>Internal Style Sheet</li><li>Inline Style</li></ol><h4>(1) External Style Sheet</h4><p>Using an external style sheet is a way to change the look of your entire application using just one file! However, you <strong><em>must</em></strong> include a reference link inside the &lt;head&gt; of every HTML page.</p><p>If your style sheet was named “appstylesheet.css”, the &lt;link&gt; in your HTML should look something like this:</p><pre>&lt;head&gt;<br>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;appstylesheet.css&quot;&gt;<br>&lt;/head&gt;</pre><p><strong><em>Keep in mind:</em></strong><em> your stylesheet needs to be saved with a </em><strong><em>.css</em></strong><em> extension!</em></p><p>appstylesheet.css might look something like this:</p><pre>h1 {<br>   color: blue;<br>   text-align: center;<br>} </pre><pre>p { <br>   color: green;<br>   text-align: left;<br>}</pre><h4>(2) Internal Style Sheet</h4><p>An internal style sheet is beneficial for when you want to style one specific page uniquely. These internal styles are defined using &lt;style&gt; element tags <em>inside an HTML </em>&lt;head&gt;.</p><p>For example, one of your HTML pages could look like this:</p><pre>&lt;head&gt;<br>&lt;style&gt;<br>   h2 { <br>      color: red; <br>      text-align: right;</pre><pre>   } <br>   <br>   p { <br>      color: purple;<br>      text-align: left;<br>   } <br>&lt;/style&gt;<br>&lt;/head&gt; </pre><h4>(3) Inline Styles</h4><p>An inline style is even more specific than an internal style sheet. This is used if you want to style one specific element on a page. They can be defined by using the <strong>style attribute</strong> inside of the HTML tag for that element.</p><p>For example, if you wanted a specific &lt;h2&gt; element to be <em>green</em>:</p><pre>&lt;h2 style=&quot;color:green;&quot;&gt;My Heading&lt;/h2&gt; </pre><p><strong><em>Keep in mind:</em></strong><em> this method is not recommended because it’s technically mixing content with presentation!</em></p><h4>Multiple Styles</h4><p>What happens when more than one style is used on an element? Which takes precedence?</p><p><strong><em>Inline style has a higher priority</em></strong> than external and internal styles. If an internal style is defined <em>after</em> the link to the external style sheet than the internal style trumps the external. This can also occur vice versa where the external style sheet link comes after the internal style.</p><h3>CSS Colors</h3><p>Colors in CSS can be defined using <a href="https://www.w3schools.com/colors/colors_names.asp">specific color names</a>, RBG, HEX, and many more! For the purpose of this blog post, I will just be covering RBG and HEX. Color can be set to HTML backgrounds, borders, text, and more!</p><h4>Backgrounds</h4><p>To use on a background, for example:</p><pre>h1 {<br>   background-color: red;<br>}</pre><pre>p { <br>   background-color: blue;<br>}</pre><p>For more cool ways to style your background, check out <a href="https://www.w3schools.com/css/css_background.asp"><strong>this</strong></a>!</p><h4>RGB Value</h4><p>RGB stands for “red”, “green”, and “blue”. Each parameter represents the intensity of the respective color by using a number between 0 and 255.</p><p>For example, green would be represented as (0, 255, 0), black as (0, 0, 0) and white as (255, 255, 255).</p><p>To use it in CSS, the rgb() function is used:</p><pre>#p1 {<br>   color: rgb(234,023,223);<br>}</pre><h4>HEX Value</h4><p>HEX value is represented as #rrggbb, also red, green and blue. Each parameter represents a hexadecimal value between 00 and ff.</p><p>To use it in CSS, no function is needed:</p><pre>#p2 {<br>   color: #ff6347;<br>}</pre><p>You can convert any color you want into RGB or HEX <a href="https://www.rapidtables.com/web/color/RGB_Color.html"><strong>here</strong></a>!</p><h3>CSS Box Model</h3><p>The CSS box model is a model used to describe the way HTML elements are represented as boxes. It’s made up of margins, borders, padding and content (as seen below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*NZg59L54B792Dcu9.png" /><figcaption>CSS Box Model</figcaption></figure><h4>Content</h4><p>The content of the box is where actual text and images appear.</p><h4>Padding</h4><p>The padding is the transparent area around the content box. The CSS padding <a href="https://www.w3schools.com/css/css_padding.asp">properties</a> are used to specify the amount of space around an element’s content box.</p><h4>Border</h4><p>The border is a <em>literal</em> border that goes around the padding and the content. The CSS border <a href="https://www.w3schools.com/css/css_border.asp">properties</a> allow you to add width, color, and style to an element’s border.</p><h4>Outline</h4><p>The outline is a line drawn outside of the border that is sometimes used to help the element “pop”. It too has several outline <a href="https://www.w3schools.com/css/css_outline.asp">properties</a> useful for styling purposes.</p><h4>Margin</h4><p>The margin is the transparent area around the border box. The CSS margin <a href="https://www.w3schools.com/css/css_margin.asp">properties</a> allow you to use CSS to specify the amount of space around elements when needed.</p><h4>Height and Width</h4><p>height and width properties are used to set the height and width of a particular element. By default these properties are set to auto, which means the browser calculates the height and width for you. Lucky for you, CSS also allows you to set your own values! This can be a specified length (in px, cm, etc.) or in a percentage (%) of the container it’s in.</p><p>For example:</p><pre>div {<br>   width: 50%;<br>   height: 220px;<br>}</pre><p><strong><em>Keep in mind:</em></strong><em> this does </em><strong><em>NOT</em></strong><em> include padding, borders, or margins!</em></p><p>Other helpful properties include max-width, max-height, min-width, and min-height. They are used in situations where the size of the element wants to be <em>adjustable</em> according to the size of the browser window and are also set using specific values or percentages. <strong><em>(These are preferred!)</em></strong></p><h4><strong>How do we measure total height and width?</strong></h4><p>Lets look at an example. Say we have a &lt;div&gt; element and wanted it to have a <em>total</em> <em>width</em> of 250px. It would most likely look something like this:</p><pre>div {<br>   width: 220px;<br>   padding: 10px;<br>   border: 5px solid red;<br>   margin: 0;<br>}</pre><p>This would equal a width of 250px because the padding and border add to <strong><em>both</em></strong> the <em>left</em> and <em>right</em> sides. (The same is true in a height situation with top and bottom.)</p><h3>CSS Text</h3><p>There are many text formatting properties that can transform and align text using CSS. Let’s take a look at a few of them!</p><h4>Alignment</h4><p>text-align is a text property used to set the <em>horizontal alignment </em>of text. It can be set to the left, right, center, or justified. When the text-align property is set to “justify”, each line of text is stretched so that every line has equal width with straight left and right margins.</p><p>For example:</p><pre>div {<br>   text-align: justify;<br>}</pre><h4>Decoration</h4><p>text-decoration is used to set or remove decorations from text. This includes overline, line-through, and underline.</p><p>For example, if you wanted to <em>remove</em> all of the underlines from your links, it would look something like this:</p><pre>a {<br>   text-decoration: none;<br>}</pre><h4>Transformation</h4><p>text-transformation is used to specify a text’s case. This includes uppercase, lowercase, and capitalize.</p><p>For example, if you wanted to <em>capitalize</em> every word in your &lt;h1&gt; element:</p><pre>h1 {<br>   text-transform: capitalize;<br>}</pre><h4>Indentation</h4><p>text-indent is used to specify indentation of the <em>first line</em> of text.</p><p>For example, if you wanted your &lt;p&gt; elements to have an indentation of 30px:</p><pre>p {<br>   text-indent: 30px<br>}</pre><h4>Letter &amp; Word Spacing</h4><p>letter-spacing is used to specify the space between the <em>characters</em> in a text. This can be a negative or a positive value.</p><p>For example, if you wanted to decrease the space in between letters by 2px:</p><pre>h2 {<br>   letter-spacing: -2px<br>}</pre><p>word-spacing works the same way, but instead adds or decreases space in between <em>words</em>.</p><h4>Line Height</h4><p>line-height specifies the space in between <em>lines of text</em>.</p><p>For example, if you wanted your lines of text to be closely packed:</p><pre>p {<br>   line-height: 0.8;<br>}</pre><h4>Shadow</h4><p>text-shadow adds shadow to text. The first argument is the horizontal shadow, the second argument is the vertical shadow, and the last argument is the color of the shadow.</p><p>If you wanted a 2px long, 3px tall, <em>blue shadow</em> under your text:</p><pre>h2 {<br>   text-shadow: 2px 3px blue;<br>}</pre><h4>Links</h4><p>As you (should) know by now, links are specified using an &lt;a&gt; tag. They can be styled with any CSS property (color, background, etc.). However, you can also style links by what <strong>state</strong> they are in! What does <em>state</em> mean though?</p><p>State has to do with the users interaction with the link. There are four: a:link, a:visited, a:hover, and a:active. “link” is a normal, unvisited link, “visited” is a link a user has visited, “hover” is a link when the user hovers over it with the cursor, and “active” is a link the moment it has been clicked.</p><p>For example, if you wanted all of your links to turn <em>purple</em> after they have been <em>clicked</em>:</p><pre>a:visited {<br>   color: purple<br>}</pre><h3>CSS Fonts</h3><p>Font can play a huge part in how your pages look, and CSS is here to help! First off, you should have a basic understanding of the two types of fonts out there: sans-serif and serif. Those projections at the end of letters (serifs) are small, but mighty and can make all the difference in the style of your page!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/0*JalVibpYBMY4lswN.png" /></figure><p>In CSS, there are two types of <em>font families. </em>The <strong>generic family</strong> and the <strong>font family</strong>. A generic family is a group of font families (Serif, Sans-Serif, Monospace, etc.). Font family refers to a specific font (Arial, Times New Roman, etc.).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*eG0zxbMk6pteq1vallFBpg.png" /></figure><h4>Family</h4><p>font-family is a property that can hold multiple font names. This is to ensure that if a browser doesn’t support the first font, it will try the next font. It’s good form to start with the font you want, and to include another within the generic family.</p><p>For example:</p><pre>p {<br>   font-family: &quot;Lucida Console&quot;, Courier, monospace;<br>}</pre><p><strong><em>Keep in mind:</em></strong><em> if the font family name is more than one word, it needs to be in “” !</em></p><h4>Web Fonts</h4><p>Web fonts allow you to use fonts that are not installed on the user’s computer. There are two ways to do this: using @fontface in your style sheet or adding a link to your HTML documents.</p><p>To use the @fontface rule, simply add it to your stylesheet(s). The two values needed are the name of the font family, and the src for the font file. Now you should have access to that font throughout your app!</p><pre>@font-face {<br>   font-family: &quot;Fluent Sitka&quot;;<br>   src: url(https://medium.com/fluent_sitka.ttf);<br>}</pre><p>To import fonts via your HTML documents, add a link into the &lt;head&gt; element to the url of your desired font:</p><pre>&lt;head&gt;<br>  &lt;link href=&quot;url&quot;&gt;<br>&lt;/head&gt;</pre><h4>Style</h4><p>font-style is a property used to specify italic text. There are three values: normal, italic, and oblique (similar to italic, but not really used).</p><h4>Size</h4><p>font-size is a property that sets the size of the text. There are two values: <strong>absolute</strong> and <strong>relative</strong>. Absolute size sets the text to a specific size and does not allow the user to change it. Relative size sets the text size relative to the elements around it. Font size can be set using <strong>pixels</strong> or <strong>em</strong>.</p><p>em allows users to resize text. 1em is equal to the current font size (the default text size in browsers is 16px). So, 1em equals 16px. The benefit to using em is that is allows the user to adjust the text size in all browsers!</p><h4>Weight</h4><p>font-weight is a property used to specify the weight of a font. There are two values: normal and bold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*02vZFTh0uNZancVf1TMcOg.gif" /></figure><h4>… tired yet?</h4><p>I know that was a lot to take in, but you did great! Part 2 should be coming out shortly, till then…</p><h3>Happy Coding :)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*U7AAe3Sqh-DnW-rrBcZ0Fg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfcc27d5dfef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git It Together]]></title>
            <link>https://medium.com/@vanessaprema/git-it-together-60298c296d37?source=rss-46372379bec0------2</link>
            <guid isPermaLink="false">https://medium.com/p/60298c296d37</guid>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Vanessa Prema]]></dc:creator>
            <pubDate>Tue, 22 Jan 2019 19:58:00 GMT</pubDate>
            <atom:updated>2019-02-05T19:22:58.710Z</atom:updated>
            <content:encoded><![CDATA[<h4>An Overview of GitHub &amp; Git Commands</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*cTPHRuyn46e4Su4QJ7S5NQ.gif" /></figure><h4>What is GitHub?</h4><p>Github.com is a website that provides a repository hosting service for version control via Git. It connects developers from across the globe to work together!</p><h4>What is Git?</h4><p>Git is a version control software that tracks changes in source code during development. While it is primarily used for multiple programmers to collaborate on one project, it is also used to manage a set of files and its respective history.</p><h4>What is “Version Control”?</h4><p>Version control is the management of changes to documents, code, or any other set of information. For example, think about an essay you’re writing. You have the first draft with the name “essay_rev1”. Then, you write another draft named essay_rev2 and so on and so forth. Doesn’t that sound so tedious? Programs like Git allow you to easily track the changes you make with each revision without having to rename and re-save. Github.com gives you all of these tools in one organized space, as well as the ability to share your code openly with other users — cool stuff!</p><h3>Gitting Started</h3><h4>Creating a GitHub Account</h4><p>One of the first things you want to do as an amateur programmer is to start a <a href="https://github.com/join">GitHub</a> account. It’s free to sign up and is an awesome (organized) way to store all of the projects you will be working on in the near future. It’s also a great place to check out other cool projects out there on the web.</p><h4>Creating a New Repository</h4><p>So you have finally created your GitHub account, now what? Let’s start a new project! The first in doing so is creating a new repository. Go to your profile page, and click on the “Repositories” tab. Then, click on the little green button in the top right-hand corner that reads “New”. But wait…</p><p><strong><em>What is a “repository”?</em></strong></p><p>Repository is another name for project. Basically it will include all the files pertinent to your project. It also shows you the history of revisions.. but we will get to that later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*-OMbqunKSpO66en59daLIA.png" /></figure><p>Now you will see a new screen with a form. While it is optional to include a description, it is highly encouraged. You will also see a checkbox to “Initialize this repository with a README”. This will automatically create a “README” file to go with your repository that allows you to basically explain what your project entails. This is also optional but encouraged!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G0RORbizcpHSlvGNcg1S8w.png" /></figure><p>Congrats! You just created your first repository, fancy stuff!</p><p>Now you are able to add files, commit, create branches, pull request, and many many more things via the GitHub website! However, for the sake of this blog, I am going to focus on how to perform these actions via your terminal using Git commands.</p><h3>Forking &amp; Cloning</h3><h4>What it means to “Fork”</h4><p>Many times you will need to “fork” a repository. What exactly does that mean? Say you saw another project from someone else’s profile, but you would like to add your own little spin. Forking a repository allows you to create a copy of your own and connecting it to your GitHub account. That way you don’t need permission from that user to make changes because you have your own version! This however, is half the battle — now you need to “clone” the repository.</p><h4>What it means to “Clone”</h4><p>Cloning is the action of downloading a repository to your computer (locally) so that you can make the changes and edits that you want to. To do so, on the repository page, click on the green button that reads “Clone or download” and copy the SSH URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*yyppJW2AjaOmPwGZ9mBn_g.png" /></figure><p>Now open your terminal, and go to the directory where you would like the repository (file) to be. Type git clone followed by the url you just copied. For example, git clone <a href="/service/mailto:git@github.com">git@github.com</a>:vprema94/medium_project.git .</p><p>Yay! Now you have a local copy of the repository on your laptop.</p><h3>Commits &amp; Git Push</h3><p>Open files using open and create new files using touch. <a href="https://www.techrepublic.com/article/16-terminal-commands-every-user-should-know/">Click here</a> for an overview of terminal commands.</p><h4>git status, git add, git commit</h4><p>Once some changes have been made to your local repository, type in git status in your terminal. This shows you all the file edits you have made.</p><p>Now that you have made all of the changes you want to, it is time to commit!</p><p><strong><em>But what does it mean to “commit”?</em></strong></p><p>A commit saves a permanent version of the project you are working on in its “history”. The history is a timeline of all of the revisions you make on a repository. All of the commits (revisions) can be accessed via your repository page on GitHub. This comes super in handy when trying to back track to previous revision or to oversee the development of your project.</p><p>In order to commit, you must “stage” your changes first. This is to prepare all of the edits you’ve made to become a permanent record (commit) in your history. To do this, type git add . (the . is there to stage ALL the changes you have made). Alternatively, you can type git add &lt;file name&gt; to only stage one specific file.</p><p>Now for the finale — time to commit! Simply type git commit -m &quot;your message” in your terminal. The message is there to help you know what changes were made in this specific commit.</p><p>To stage <strong><em>and</em></strong> commit all of the edits you’ve made in one go, use git commit -am &quot;your message&quot;.</p><h4>git push</h4><p>Now that we have made changes, staged, and committed, we need to push them to GitHub. Pushing is the process of taking the code you have locally and uploading them to GitHub. The GitHub “remote” is the place where you initially copied the code from (remote = fancy way of saying copy of repository). The remote name in this scenario is origin. origin is the default name given to the remote by GitHub when we fork the project. In order to <em>push</em> this back to GitHub, enter into your terminal git push origin master. But wait, where did master come from?!</p><h3>Branching &amp; Merges</h3><h4>master Branch</h4><p>Now that you are familiar with committing and pushing up to GitHub, let’s discuss branching! So far, the changes you have made have been pushed up to GitHub on the master branch. This branch is the linear list of changes from your initial repository. You can create a new branch and work on a feature of your code to then later merge it with the master branch, as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*hzqbq7p0o3npiPWQpQeXWQ.png" /></figure><p>Branching is beneficial because it allows the user to separate different ideas and versions without fully integrating them into the project. It’s especially a great tool to use when working with multiple collaborators!</p><h4>Creating Branches</h4><p>Now, if you enter git branch you will see you are in the master branch (it should be highlighted). So let’s try making a new branch and adding some changes to that.</p><p>To make a new branch type git branch &lt;branch name&gt;. To move into this branch, type git checkout &lt;branch name&gt;. A shortcut would be to type, git checkout -b &lt;branch name&gt; — this creates a new branch AND moves you into it. Now if you enter git branch you will see that you are in the new branch you just created, wowza!</p><p>Now that you are here, make some new changes to your files, stage and commit these edits.</p><h4>Merging Branches</h4><p>Merging is a way to combine changes. You can make multiple branches and have multiple merges across your repository. It can be as complex or as simple as you want it to be!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*roh6Eb2dFSeQhM0Fgs0cng.png" /></figure><p>Let’s try to merge these changes with the master branch. First, go back to your master branch by typing git checkout master. Then, git merge &lt;branch name&gt;. Congrats, you just completed your first merge! Now that this is merged locally, don’t forget to push these changes to GitHub with git push origin master.</p><h4>Deleting a Branch</h4><p>If you no longer want to keep a branch, simply delete with git branch -d &lt;branch name&gt;.</p><h3>Remote Branches &amp; Fetching</h3><h4>git fetch</h4><p>Now say you are working with your friend Tez on this repository. You made him a <a href="https://help.github.com/articles/inviting-collaborators-to-a-personal-repository/">collaborator</a> and have both cloned the repository locally. Tez is working on a branch called “tez”. Tez has committed and pushed his changes to the origin and now you want to see them. How would you do that from your terminal?</p><p>By using git fetch origin tez and then git checkout tez. You have added Tez’s branch to your local repository from the origin repository! Now you can see all of the changes Tez has made and merge them to the master and push them to the origin.</p><h4>git pull</h4><p>Now if you want to get <em>fancy</em> you can use git pull which <strong>fetches</strong> and <strong>merges</strong> everything from the origin! Remember to be in the branch in which you want to merge. This can be a <strong>dangerous tool</strong> if your local remote is not up-to-date with the origin remote, <em>so be careful</em>!</p><h3>Pull Request</h3><h4>What is a pull request?</h4><p>A pull request is literally how it sounds, it is a request for someone to pull your changes!</p><p>Now say if Tez wasn’t a collaborator, but some random dude who decided to fork and clone your repository because it sounded like a cool project. He made some awesome edits and wants to share them with you. In this scenario, he would make a pull request via GitHub.</p><p>In order to this, Tez would simply go to his repository page in GitHub and select the button that reads “New Pull Request”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*teXTcm2a_qhi6VHSpATyhw.png" /></figure><p>Now I would get a notification on my GitHub account that Tez has made a request to add to my repository and can decide to merge from there!</p><h3>Happy Coding :)</h3><p>I hope this was helpful and informative!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*6Kaa7nN-dwK4F70EYuBInA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60298c296d37" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active Record Associations]]></title>
            <link>https://medium.com/@vanessaprema/active-record-associations-d324ce9ebc0b?source=rss-46372379bec0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d324ce9ebc0b</guid>
            <category><![CDATA[sqlite]]></category>
            <category><![CDATA[activerecord]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Vanessa Prema]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 14:35:31 GMT</pubDate>
            <atom:updated>2019-01-08T18:51:30.685Z</atom:updated>
            <content:encoded><![CDATA[<h4>in a nutshell</h4><h4><strong>What is an association?</strong></h4><p>An association is a relationship between two Active Record models. They make our lives easier by creating connections and methods between models so we don’t have to (yay)!</p><h4><strong>How are associations related?</strong></h4><p>Association relationships are created by maintaining <strong>primary key-foreign key</strong> information between instances of models. This connection defines a one-to-many relationship between two tables in a database. In our case, the tables are made up of <em>instances</em> of each model. A primary key is a column where each value is <em>unique</em> and identifies a single row of a table (AKA an instance of a model in Active Record). A foreign key is a column in one table that <em>references</em> the primary key column in another table. In general, both primary and foreign keys are represented as integers.</p><h4>Our Example</h4><p>For the sake of this post, consider a Rails application that has models for recipes, ingredients, and cuisines. Let’s explore all the possible associations that can occur between these models.</p><h4><strong>3 Types of Associations (covered in this post):</strong></h4><ol><li>belongs_to</li><li>has_many</li><li>has_many :through</li></ol><h4><strong><em>(1) belongs_to</em></strong></h4><p>A belongs_to association creates a one-to-one relationship with another model, so that every instance of a model “belongs to” one instance of the other model.</p><p>When using a belongs_to association, the other model must be singular, otherwise the class will become incorrectly pluralized, resulting in an error.</p><p>For example, our application has many recipes, but each recipe belongs to only one cuisine.</p><p><strong>The recipe model would be declared as:</strong></p><pre>class Recipe &lt; ApplicationRecord<br>  belongs_to :cuisine<br>end</pre><p><strong>The migration for these models might look like:</strong></p><pre>class CreateRecipes &lt; ActiveRecord::Migration<br>  def change<br>    create_table :recipes do |t|<br>      t.string :name<br>      t.integer :cuisine_id<br>    end</pre><pre>    create_table :cuisines do |t|<br>      t.string :name<br>    end<br>  end<br>end</pre><p><strong><em>Behind the Scenes:</em></strong></p><p>Now that we have established a belongs_to relationship between recipes and cuisine, we can use <strong>recipe.cuisine </strong>to return the cuisine associated with a specific instance of a recipe! But how does Active Record do this through SQL? By using SELECT and foreign keys! For this example, the SQL statement would read:</p><pre>SELECT &quot;cuisines&quot;.* FROM &quot;cuisines&quot; WHERE &quot;cuisines&quot;.&quot;id&quot; = ? LIMIT ?</pre><p>This SQL statement goes to the <em>cuisines</em> table and finds the entry that has the same <em>id</em> as the <em>cuisine_id</em> from the recipe entry, essentially comparing the primary keys to the foreign key.</p><h4><strong><em>(2) has_many</em></strong></h4><p>A has_many association creates a one-to-many relationship with another model, so that every instance of a model “has_many” instances of the other model.</p><p>When using a has_many association, the other model must be plural, otherwise the class will be incorrectly read by Active Error and result in an error.</p><p>In our application, each cuisine type can have many recipes, but only one cuisine belongs to each recipe.</p><p><strong>The cuisine model would be declared as:</strong></p><pre>class Cuisine &lt; ApplicationRecord<br>  has_many :recipes<br>end</pre><p><strong>The migration for these models might look like:</strong></p><pre>class CreateCuisine &lt; ActiveRecord::Migration<br>  def change<br>    create_table :cuisines do |t|<br>      t.string :name<br>    end</pre><pre>    create_table :recipes do |t|<br>      t.string :name<br>      t.integer :cuisine_id<br>    end<br>  end<br>end</pre><p><strong><em>Behind the Scenes:</em></strong></p><p>Now that we have established a has_many relationship between cuisines and recipes, we can use <strong>cuisine.recipes </strong>to return all of the recipes associated with a specific instance of a cuisine! But how does Active Record do this through SQL? By using SELECT and foreign keys! For this example, the SQL statement would read:</p><pre>SELECT &quot;recipes&quot;.* FROM &quot;recipes&quot; WHERE &quot;recipes&quot;.&quot;cuisine_id&quot; = ?</pre><p>This SQL statement goes to the <em>recipes</em> table and finds all the entries that has the same <em>cuisine_id</em> as the <em>id</em> from the cuisine entry, essentially comparing the foreign keys to the primary key.</p><h4><strong>(3) has_many :through</strong></h4><p>A has_many :through association creates a many-to-many relationship with another model, so that many instances of a model “has many” instances of the other model. This is achieved by creating an additional relationship via a third model.</p><p>When using a has_many :through association, the other model must be plural, otherwise the class will be incorrectly read by Active Error and result in an error.</p><p>In our application, each ingredient type can be in many recipes, and each recipe can have many ingredients. But what model would join these two models through? This <em>joiner</em> model must have a belongs_to association to both recipe class and ingredient class. Hmm… can’t think of any? Then I guess we’ll make up our own!</p><p>In many cases, there is a joiner model that is part of your application that can join two models via the has many :through association, but when there is not one present, one must be made. For our purposes, Recipe_Ingredient will be created to help represent the relationship between the recipe model and the ingredient model.</p><p><strong>These models would be declared as:</strong></p><pre>class Recipe_Ingredient &lt; ApplicationRecord<br>  belongs_to :recipes<br>  belongs_to :ingredients<br>end</pre><pre>class Recipe &lt; ApplicationRecord<br>  belongs_to :cuisine<br>  has_many :ingredients, through: :recipe_ingredients<br>end</pre><pre>class Ingredients &lt; ApplicationRecord<br>  has_many :recipes, through: :recipe_ingredients<br>end</pre><p><strong>The migration for these models might look like:</strong></p><pre>class CreateRecipeIngredients &lt; ActiveRecord::Migration<br>  def change<br>    create_table :ingredient do |t|<br>      t.string :name<br>    end</pre><pre>    create_table :recipes do |t|<br>      t.string :name<br>      t.integer :cuisine_id<br>    end<br>  end</pre><pre>    create_table :recipeingredients do |t|<br>      t.integer :ingredient_id<br>      t.integer :recipe_id<br>    end<br>  end<br>end</pre><p><strong><em>Behind the Scenes:</em></strong></p><p>We have established a has_many :through relationship between ingredients and recipes through our joiner recipe_ingredients. Now we can use <strong>recipe.ingredients </strong>to return all of the ingredients associated with a specific instance of a recipe! How does Active Record do this through SQL? By using SELECT and INNER JOIN! For this example, the SQL statement would read:</p><pre>SELECT &quot;ingredients&quot;.*<br>FROM &quot;ingredients&quot;<br>INNER JOIN &quot;recipe_ingredients &quot; ON &quot;ingredients&quot;.&quot;id&quot; = &quot;recipe_ingredients”. ingredient_id&quot;<br>WHERE &quot;recipe_ingredients&quot;.&quot;recipe_id&quot; =?</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*Fuh4KfQHmWeR5nl3tmXEag.gif" /></figure><p>Hmm, that seems like a lot to take in, let’s break it down.</p><p>First, SQL is selecting all of the ingredients from the ingredients table. Then it does an inner join with the recipe_ingredients table to match up the ingredient.id’s (from ingredients) to the ingredient_id’s (from recipe_ingredients).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*kh2Y7o1BzBnRoY9QngkTAA.png" /><figcaption>Inner Join Venn Diagram</figcaption></figure><p>Then it takes the recipe.id from our recipe and compares the recipe_id’s from the join table and selects only those ingredients that have a match!</p><p>Basically, SQL is able to find all of the ingredients that have the same recipe_id as our recipe <em>through</em> the recipe_ingredients joiner and spit it out to us, neato!</p><h3>The Big Picture</h3><p><em>This schematic lays out all the models, their associations as well as their respective table column names.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*g6-BuS36W1D0zfjihAN7yA.png" /></figure><h3>Happy Coding! :)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*34xEodIKs2f9yyGICYX9Mw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d324ce9ebc0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>