<?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 Jonathan Stricklin on Medium]]></title>
        <description><![CDATA[Stories by Jonathan Stricklin on Medium]]></description>
        <link>https://medium.com/@jstricklin89?source=rss-eef18e3527f9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-GJIUo-2v0qgpKmgL2lVDQ.jpeg</url>
            <title>Stories by Jonathan Stricklin on Medium</title>
            <link>https://medium.com/@jstricklin89?source=rss-eef18e3527f9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 06:46:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jstricklin89/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[Javascript Fundamentals: Apply, Call, and Bind]]></title>
            <link>https://medium.com/@jstricklin89/javascript-fundamentals-apply-call-and-bind-39a602078a9a?source=rss-eef18e3527f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/39a602078a9a</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jonathan Stricklin]]></dc:creator>
            <pubDate>Tue, 12 Feb 2019 20:53:28 GMT</pubDate>
            <atom:updated>2019-02-12T20:53:28.810Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Gin_kP78XwW3mTybF58zA.png" /></figure><h4>‘This’ a brief definition</h4><p>To fully understand apply, call, and bind, we need to just do a quick step back and make sure we understand the purpose of ‘this’ in Javascript. The easiest way to summarize and define this would be: a keyword that allows you to decide which object should be focal when invoking a function/method.</p><h4>The ‘Call’ Keyword</h4><p>Every function in Javascript has a built-in function that allows you to use the call keyword so you can specify what scope the function will be invoked in. If you function/method is not directly inside of what you are trying to bind to, call is one of the ways you can still attach that separate scope to the function.</p><p>An example looks like this:</p><pre>greet.call(user)</pre><p>Greet is the function needing the user scope, so it uses the bind keyword to accomplish that.</p><p>Call requires you to place multiple arguments in one at a time. If you had many arguments needing to be passed, or maybe even an array, that is what the next keyword sets out to solve for us. Let’s take a look.</p><h4>The ‘Apply’ Keyword</h4><p>If you were going to pass multiple keywords to our previous example it would look like so:</p><pre>greet.call(user, array[0], array[1], array[2])</pre><p>Like I said above, the apply keyword is not very different from the call keyword. You can see the only real difference in the example below.</p><pre>const array = [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;]<br>greet.apply(user, array)</pre><h4>The ‘Bind’ Keyword</h4><p>The <strong>bind()</strong> method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.</p><pre>var person = {  <br>  name: &quot;James Smith&quot;,<br>  hello: function(thing) {<br>    console.log(this.name + &quot; says hello &quot; + thing);<br>  }<br>}<br><br>person.hello(&quot;world&quot;);  // output: &quot;James Smith says hello world&quot;<br>var helloFunc = person.hello.bind({ name: &quot;Jim Smith&quot; });<br>helloFunc(&quot;world&quot;);  // output: Jim Smith says hello world&quot;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39a602078a9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Fundamentals: Understanding Prototypes]]></title>
            <link>https://medium.com/@jstricklin89/javascript-fundamentals-understanding-prototypes-ec6717abd881?source=rss-eef18e3527f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec6717abd881</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jonathan Stricklin]]></dc:creator>
            <pubDate>Fri, 08 Feb 2019 19:36:39 GMT</pubDate>
            <atom:updated>2019-02-08T19:36:39.799Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Gin_kP78XwW3mTybF58zA.png" /></figure><p>Javascript fundamentals is a series of quick bite blog posts that cover important Javascript concepts everyone needs to know.</p><h4>Quick Definition</h4><p>Prototypes are the mechanism by which JavaScript objects inherit features from one another.</p><h4>Why I’m blogging about Prototypes?</h4><p>One of the things I have been enjoying lately as I continue to code daily is learning what is behind the “magic” of some programming tools, frameworks, or languages that I learned earlier in my education and only now am finally really starting to understand. Prototypes really helped me uncover and understand some of the “magic” behind Javascript and how everything connects together behind the scenes.</p><h4>Prototypes</h4><p>Javascript is known as a prototype-based language. Perl and Python are two other examples of languages that have a similar functionality built into part of the language.</p><p>Every function in Javascript has a prototype property attached to it and that property is what allows us to share methods across all instances of a function and pass methods up and down the prototype chain.</p><p>The prototype chain is the connection of one prototype property all the way up to the outermost prototype property that will have a value of null. This chaining or bubbling effect is what allows all objects in Javascript to talk to each other and share information.</p><h4>Example</h4><pre>function Mammal(){<br>  this.bloodTemp = &#39;warm&#39;;  <br>}<br><br>function Carnivore(){}<br><br>function Tiger(name){<br>  Mammal.call(this); <br>  this.name = name;<br>}</pre><pre>Mammal.prototype.getBig = function(){<br>   console.log(&#39;samson just gained 10 lbs&#39;);<br>}<br><br>Carnivore.prototype = Object.create(Mammal.prototype);<br><br>Carnivore.prototype.eatMeat = function(){<br>  console.log(&#39;Mmm.Food&#39;);<br>};<br><br>Tiger.prototype = Object.create(Carnivore.prototype);<br><br>Tiger.prototype.feeling = function(){<br>  console.log(&#39;like a beast&#39;);<br>};</pre><pre>var samson = new Tiger(‘samson’)<br>samson.getBig() // samson just gained 10 lbs<br>samson.eatMeat()  // Mmm.Food<br>samson.pride()    //like a beast<br>samson.bloodTemp  // warm</pre><p>Thanks for reading! Until next time…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec6717abd881" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Computer Science Fundamentals: Big O Notation]]></title>
            <link>https://medium.com/@jstricklin89/computer-science-fundamentals-big-o-notation-e5b930ac36f4?source=rss-eef18e3527f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5b930ac36f4</guid>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Jonathan Stricklin]]></dc:creator>
            <pubDate>Fri, 01 Feb 2019 00:12:10 GMT</pubDate>
            <atom:updated>2019-02-01T00:12:10.394Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*k-acuFitTKegB5l5JTn0tA.png" /><figcaption>Big-O Diagram</figcaption></figure><p>This blog post is going to be a slight side step from the series on Javascript fundamentals, but it serves the same overall purpose: To prepare any new programmer for their first developer interviews and have some bit sized blog posts to help them along the way.</p><h4>What is Big O Notation?</h4><p>Big O Notation is what we use to talk about how long an algorithm will take to run. We will be able see the differences in efficiency between different algorithms and multiple variations of a single algorithm.</p><p>Lets look at each Big O example in order of time complexity like they are on the graph above!</p><h4>Time complexity O(1) — Constant Time</h4><p>This just means the method will always require only one step.</p><p>Here are some popular examples of O(1):</p><p>1. Accessing Array Index (int a = ARR[5];)<br>2. Inserting a node in Linked List<br>3. Pushing and Poping on Stack<br>4. Insertion and Removal from Queue<br>5. Finding out the parent or left/right child of a node in a tree stored in Array<br>6. Jumping to Next/Previous element in Doubly Linked List</p><h4>Time complexity O(logn)</h4><p>The best way to understand this one in my opinion is understanding how a binary search works or thinking through the common phonebook example.</p><p>Phonebook example: If you are given a name to look up in the phonebook you go to the middle of the phonebook and are able to remove half of the phonebook based on in the name is in the first half or second half of the alphabet. Keep doing this method until you have found the name.</p><p>So logn would be the above example, but O(n) would mean going through every single name.</p><p>Here are some popular examples of O(logn):</p><p>1. Binary Search<br>2. Finding largest/smallest number in a binary search tree<br>3. Certain Divide and Conquer Algorithms based on Linear functionality<br>4. Calculating Fibonacci Numbers — Best Method</p><h4>Time complexity O(n) — Linear Time</h4><p>As I hinted above, you can think of these algorithms as having to go through the phonebook one name at a time. That is what makes this example linear.</p><p>Here are some popular examples of O(n):</p><p>1. Traversing an array<br>2. Traversing a linked list<br>3. Linear Search<br>4. Deletion of a specific element in a Linked List (Not sorted)<br>5. Comparing two strings<br>6. Checking for Palindrome<br>7. Counting/Bucket Sort</p><h4>Time complexity O(nlogn)</h4><p>This is where many of the famous sorting algorithms land on the Big O spectrum. The formal definition isn’t very helpful: “n times the logarithm base 2 of n”. So lets just think of sorting as the best way to understand it and see the examples of that below.</p><p>Here are some popular examples of O(nlogn):</p><p>1. Merge Sort<br>2. Heap Sort<br>3. Quick Sort<br>4. Certain Divide and Conquer Algorithms based on optimizing O(n²) algorithms</p><h4>Time complexity O(n²) — Quadratic Time</h4><p>One way I like thinking of this type of algorithm is if you have two nested loops. The inner most loop has to run n times and the outer loop has to run n times for each iteration of the inner loop. So you end up with n² times.</p><p>Here are some popular examples of O(n²):</p><p>1. Bubble Sort<br>2. Insertion Sort<br>3. Selection Sort</p><h4>Time complexity O(2^n)</h4><p>Algorithms with running time O(2^N) are often recursive algorithms that solve a problem of size N by recursively solving two smaller problems of size N-1.</p><p>One way I saw this explained that I liked was like so: Imagine a set of n switches, each of them corresponding to one element of a set. Now, each of the switches can be turned on or off. Think of “on” as being in the subset.</p><p>Here are some popular examples of O(2^n):</p><ol><li>Tower of Hanoi</li><li>Many recursion algorithms(usually inefficient ones)</li></ol><h4>Time complexity O(n!) — Factorial time</h4><p>Just look up factorials and it will make it clear why this one is the worst. For example: 100! = 9.332621544×10^157 (thats a really big number!)</p><p>Example of O(n!):</p><ol><li>Traveling salesman problem solved w/ brute force</li><li>Enumerating all partitions of a set</li></ol><h4>Helpful Extras</h4><p>One of my favorite stack overflow articles on this: <a href="https://stackoverflow.com/questions/2307283/what-does-olog-n-mean-exactly">https://stackoverflow.com/questions/2307283/what-does-olog-n-mean-exactly</a></p><p>Nice diagram breaking Big O down:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*uugkl8vfrKawBMaB9_FK7Q.jpeg" /><figcaption>Diagram of Big O for data structures and arrays</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5b930ac36f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Fundamentals: Var, Let, Const]]></title>
            <link>https://medium.com/@jstricklin89/javascript-fundamentals-var-let-const-3e49fbd4d39c?source=rss-eef18e3527f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e49fbd4d39c</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jonathan Stricklin]]></dc:creator>
            <pubDate>Sat, 26 Jan 2019 23:13:04 GMT</pubDate>
            <atom:updated>2019-01-26T23:13:04.348Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Gin_kP78XwW3mTybF58zA.png" /></figure><p>Javascript fundamentals is going to be a series of quick bite blog posts that cover important Javascript concepts everyone needs to know.</p><h3>Let</h3><p>Let is a variable in Javascript that allows you to declare it to a specific block and it can only be used in that block, not the entire function. You cannot have two let variables with the same name in a function or block. You can reassign or change the variable value with let. This is useful when you have counters, changing state values, etc. in your code.</p><h3>Const</h3><p>Const is the other newer variable type in Javascript alongside ‘let’. Const is also assigned at the block level and cannot be seen by the entire function unless assigned globally. It cannot be changed through reassignment. This is the key difference between const and let. Const also cannot be redeclared.</p><h3>Var</h3><p>Var is the original variable defining type in Javascript. In 99.9% of circumstances you should no longer use var when writing Javascript but you may see it pop up in legacy codebases and need to be aware of its properties. Var does not apply to a specific block, but can be accessed across an entire function. This can cause issues if it is called or changed elsewhere in a function.</p><p>The variable may or may not be reassigned, and the variable may or may not be used for an entire function, or just for the purpose of a block or loop. When you put all these traits together, it makes for a very weak variable definition.</p><h3>Conclusion</h3><p>The main takeaway here is mostly for new developers that have not seen or heard of ‘var’ now that ‘let’ and ‘const’ are the standard for variable assignment in Javascript. If you end up in a codebase that uses var it will be helpful to understand how it works so you don’t end up being stuck with random bugs from the scoping issues var can cause.</p><p>Until next time. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e49fbd4d39c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Future Computer Science Studies after programming bootcamp]]></title>
            <link>https://medium.com/@jstricklin89/future-computer-science-studies-after-programming-bootcamp-3bd737901edb?source=rss-eef18e3527f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bd737901edb</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Jonathan Stricklin]]></dc:creator>
            <pubDate>Fri, 18 Jan 2019 13:45:26 GMT</pubDate>
            <atom:updated>2019-01-18T13:45:26.529Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*BgHsH5GJI3avG7kbHiaFog.png" /></figure><h3>Deciding to do a programming bootcamp in the first place can be a long process that involves many decisions along the way. Living in Texas, I feel lucky to have had the opportunity to enroll at the Flatiron School in Houston, TX. I wasn’t sure if I was going to do a bootcamp in Texas with the options that were available, but thankfully Flatiron opened their doors for the first time in Texas less than two months before I started at Flatiron. I am now past the halfway point of the total fifteen weeks for the bootcamp, and wanted to put my thoughts via this blog on how I will approach a continuing education after this program. The way I will approach this here will be focused on the computer science components I feel like I should learn to have an even stronger foundation to build a career with.</h3><h4>OSSU: Open Source Society University</h4><p>I have been looking into computer science and bootcamps for the past couple years now. My favorite resource I have found so far came through GitHub and is basically an educated curation of all the best free resources on the internet, combined and organized so anyone can finish part or all of computer science degree online. Some of the courses in the program include schools like Stanford, MIT, UT Austin, Hebrew University of Jerusalem, Harvard, Princeton, and many other top computer science programs from around the world.</p><h4>How the curriculum was built</h4><p>The founders of this project created some basic guidelines before building this course that I will list below:</p><p>The classes must be available for enrollment to be included on the list.</p><p>The classes must have enrollment opportunities at least once a month.</p><p>They created academic requirements which can be found <a href="https://github.com/ossu/computer-science/blob/dev/REQUIREMENTS.md">here</a>.</p><p>Keep an even progression of difficulty to balance with the rest of the course.</p><p>Have a high quality with respect to the teaching materials and pedagogical principles.</p><h4>How the curriculum is organized</h4><p>Intro CS: Get a taste of computer science with these courses to see if CS is something you will enjoy learning. I had started some of these classes, but may not end up going back to them after finishing bootcamp. Still deciding on this part.</p><p>Core CS: These all related to the first three years of a normal computer science program. This and advanced CS is where I obviously plan to spend most of my time after finishing bootcamp.</p><p>Advanced CS: These courses all come from the final year of a computer science degree and all build off of intro and core CS principles and will need to be obtained before starting any of these. The program creators did a good job of lining out the prerequisites so you don’t get in over your head on accident.</p><p>Final Project: Similar to a final project you would complete in a bootcamp. They have guidelines, but it really is up to you on how to approach this part. This is good practice in being honest with yourself, combining all your knowledge, and putting it all to practical use with a project that will push you to become even better and add another big piece to your portfolio/resume.</p><p>Pro CS: Graduate level studies. These are good especially if you plan on specializing in something. I also think at this point it is a good idea to look at the open source projects schools like MIT have done <a href="https://ocw.mit.edu/courses/find-by-topic/#cat=engineering&amp;subcat=computerscience">here</a>. It will blow your mind just how many computer science courses top schools have placed online for anyone to access the materials.</p><h4>How long would it take to complete it all?</h4><p>This obviously depends on you for many different reasons. The course creators say the core CS can be completed in 2 years if you dedicate 18–22hrs a week to the classes.</p><h4>Is it really free?</h4><p>Everything in the curriculum can be free until you get to certain classes in the Advanced CS part of the program. Many of the free courses are provided through online course companies like: Udemy, Udacity, EdX. These companies give you the option to pay anywhere from $10-$100 so you can actually be graded on the materials and receive an official certificate of completion after finishing the program. I personally chose to pay the $50 for the grading and certificates for the three courses I have started so far.</p><h4>Class list examples</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*cvok-wWG8iyM32gQrk7uDA.png" /><figcaption>Intro to Computer Science section</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*QQ6A7VPj7Xm5zzO1poqRBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*hjdYiNr_ZIwuchVtrEQJCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*pyeL6ZjWFaDLXgZRqmI9ng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*RJCgyVXeUPfgDyQDlVUGqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*AtEN5yxmr3jGp9RR3wPc5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*1X32U7j364Nu9Yc35nb8Zw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*Fpk4TsCivGEll0Apxnu4qA.png" /></figure><h4>Link to the GitHub repo</h4><p><a href="https://github.com/ossu/computer-science">GitHub - ossu/computer-science: 🎓 Path to a free self-taught education in Computer Science!</a></p><h4>Concluding Thoughts</h4><p>Hopefully access to all these great resources are as exciting to you as they are for me. The list of classes I want to take out of this program should keep me busy for a few years after graduating from Flatiron. Hopefully this article will have you take a look at the program and help in your path to learning more about programming and computer science too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bd737901edb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sending Emails in Ruby on Rails Apps]]></title>
            <link>https://medium.com/@jstricklin89/sending-emails-in-ruby-on-rails-apps-f0652449ca05?source=rss-eef18e3527f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0652449ca05</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[email]]></category>
            <dc:creator><![CDATA[Jonathan Stricklin]]></dc:creator>
            <pubDate>Thu, 27 Sep 2018 17:18:33 GMT</pubDate>
            <atom:updated>2018-09-27T17:18:33.230Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*4kOG5KNumg-nImIn8zg15g.gif" /><figcaption>One of the first structured emails ever sent on ARPANET in 1977</figcaption></figure><h4>Introduction</h4><p>As I am in the process of learning Ruby on Rails, during my journey of learning to code in general, I came across something called UserMailer. I thought it would be interesting to see how UserMailer allows emails to be sent via your rails application and wanted to better understand how it works. It turned out to be pretty simple to get the basics of UserMailer working in any existing project or application you are working on, so this blog will serve to give you the bare basics of how to get a basic email sent from your application. <em>The example used here will be a new user creating an account on our website and receiving a welcome email from the application.</em></p><h4>Preliminary Items</h4><p>To get started we need to make sure two things are already complete:</p><ol><li>Create an email account so you have a login we can use for this additional code that will be added. Gmail is an easy default one to use. You can sign up for one quickly <a href="https://accounts.google.com/signup/v2/webcreateaccount?hl=en&amp;flowName=GlifWebSignIn&amp;flowEntry=SignUp">here</a>.</li><li>Already have a rails application built. If you do not have one yet but want to code along with this blog post, just create a new rails project like so: rails new &lt;your_new_app_name&gt;.</li></ol><h4>Generate the UserMailer in your application</h4><p>Run rails g mailer UserMailer in your terminal. This will create a mailer controller, text views, html views, and your folder structure for these views. It actually creates a few more files than this, but they will not be edited for the purposes of this blog post.</p><h4>Set default :from address in controller/mailer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*rX34iFcYgE2eIeag5x-xYw.png" /><figcaption>This sets our default email address the controller will use to send emails</figcaption></figure><h4>Create welcome_email method in UserMailer model</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*tIidRY1XoIC-pFDwPMUA0w.png" /><figcaption>This method sends the welcome email to the new user</figcaption></figure><h4>Configuration settings: Gmail example</h4><p>Here we are adding some settings to config/environments/development.rb</p><p>perform_deliveries allows the application to send</p><p>default_options connects our default email address to the app</p><p>delivery_method is set to smtp, simple mail transfer protocol, which is the largest standard email protocol the world uses today.</p><p>smtp_settings all our email settings that are standard from our email provider, gmail in this case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*bV0whw8-HKI9KZP9LI1VJg.png" /><figcaption>Ignore the user_name and password for now, I will address this soon</figcaption></figure><p>delivery_method performs the send action that is allowed from perform_deliveries above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*a85hLnE_8D_7p38WM_XXAA.png" /></figure><h4>Security: Environment variables</h4><p>Environment variables have been one of the best tools i’ve learned during this process. When programs are developed, we will usually have data that needs to be securely stored somewhere and accessible by our application, but not made public on GitHub or in our application. This is where environment variables come in!</p><ol><li>Create a file config/local_env.yml</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*qUb7uuNHAvdNIYjb1Q3zsQ.png" /><figcaption>Add these lines into your new config file</figcaption></figure><p>2. Go into your gitignorefile in your root directory application folder to add the following lines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*mLqG8ShKRYp-OvbfLvgd8A.png" /><figcaption>Add your new config file to the gitignore</figcaption></figure><blockquote>This prevents the config/local_env.yml file from being checked into a git repository and made available for others to see.</blockquote><p>3. Add following code to your config/application.rb file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*8gZthwTWKGKAWFKNQtk64A.png" /><figcaption>This allows your environment variables to be used in your application</figcaption></figure><p>4. Your config in development.rb will now work!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*bV0whw8-HKI9KZP9LI1VJg.png" /><figcaption>user_name and password now holds your environment variables</figcaption></figure><p>Use ENV[“MAIL_USERNAME”] anywhere in a Rails application.</p><h4>Create views for email confirmations</h4><p>Create a file called welcome_email.html.erb in app/views/user_mailer/. This will be our html version of the welcome_email to be sent.</p><p>Also create a filewelcome_email.text.erb in the same folder for users not able to view the html version of the email in their browser. This is the text version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*5MFA67GOi-f-mkk11kRjuQ.png" /><figcaption>html view</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*NzEXGScarVhjp2lL2UZ6ag.png" /><figcaption>text view</figcaption></figure><h4>Controller method to send email when users are created</h4><p>Finally, in our users controller we can create a create method that will generate the welcome email once a new user is created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*HVnsBaQCiSgkEQYMYiD0bA.png" /></figure><h4>The result from our application</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*7-lCeXpmAhTOv3It6GECgA.gif" /><figcaption>Testing the email welcome message with new user</figcaption></figure><pre>sent mail to abc@gmail.com (2023.Sms)<br>[ActiveJob] [ActionMailler::DeliveryJob] [2cfde3c-260e-4a33-1a6ada13a9b] Date: Thu, 27 Sept 2018 11:44:05 +0530<br>From: rubyonrailflatironmailer@gmail.com<br>To: abc@gmail.com<br>Message-Id: &lt;559e112d63c57_f1031e7f23467@kiranPro.mail&gt;<br>Subject: Welcome to testflatironmailer.com<br>Mime-Version: 1.0<br>Content-Type: multipart/alternative;<br>boundary=&quot;--mimepart_559e112d601c8_f1031e7f20233f5&quot;;<br>charset=UTF-8<br>Content-Transfer-Encoding:7bit</pre><p>The above happens in our program once the user submits their information on the create login page. We have successfully sent an email from our application. Awesome!</p><h4>Resources</h4><p>Here is the rails guide for <a href="https://guides.rubyonrails.org/action_mailer_basics.html">ActionMailer</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0652449ca05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Use Git & GitHub for Pair Collaboration]]></title>
            <link>https://medium.com/@jstricklin89/git-github-collaboration-34229a4438e5?source=rss-eef18e3527f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/34229a4438e5</guid>
            <category><![CDATA[pair-programming]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[bootcamp]]></category>
            <dc:creator><![CDATA[Jonathan Stricklin]]></dc:creator>
            <pubDate>Thu, 13 Sep 2018 16:41:34 GMT</pubDate>
            <atom:updated>2018-09-13T20:05:21.337Z</atom:updated>
            <content:encoded><![CDATA[<h3>What this article covers</h3><p>I am starting my journey to learn programming and having to collaborate with other users to complete programs in ruby. I have found everything related to code to be very invigorating, but also very challenging. Git and GitHub were some of the tools I just expected to have come naturally to me, but I was wrong. With videos, practice, diagrams, and help from colleagues I finally was able to better understand a small part of Git and GitHub, and that is what will be discussed in this post. I will show one method for collaborating on a project with another developer in GitHub.</p><h3>Starting points</h3><p>So, this article will assume a few things I want to make sure we cover first. Please use the following support tools if you do not have Git and GitHub working correctly on your computer before trying anything else in this article.</p><p>You can check to see if you have git installed by running this command in your command line:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*M6Q2aNKS6WmJtsXv9XVVPw.png" /><figcaption>Open up a terminal session to run ‘git version’ to see if you have git installed</figcaption></figure><p>If Git is not installed, just follow the article linked below to get you setup with Git. Did I ‘git’ you there?</p><p><a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">Git - Installing Git</a></p><p>Chances are Git is already installed. The next step will be making sure you have a GitHub account. Just follow along on this next article:</p><p><a href="https://github.com/join">Build software better, together</a></p><h3>Collaborating</h3><p>Now for the fun part. Working with other people to build awesome projects together. Lets get started. I am going to be writing this article based on the assumption that we will fork a repository to start our collaboration. There are other ways to collaborate via GitHub, but most of the steps will still be similar, and collaborating from a fork will be my focus.</p><h4>How to fork</h4><p>Creating a fork produces a copy of an existing project for you to start using yourself. The details of forking are explained well by GitHub, so I feel it is best to let them introduce this topic since I will be focusing on the details of collaborating. See the article below to fork:</p><p><a href="https://guides.github.com/activities/forking/">Forking Projects</a></p><h3>Add a collaborator</h3><ol><li>Navigate to the repository on Github to share with your collaborator.</li><li>Click on the “Settings” tab on the right side of the menu at the top of the screen.</li><li>On the new page, click the “Collaborators” menu item on the left side of the screen.</li><li>Type new collaborator’s GitHub username into the text box.</li><li>Select the GitHub user from the list that appears.</li><li>Click the “Add” button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*1brEmUBhS7VbsSEa3qdExw.png" /><figcaption>Settings -&gt; Collaborators -&gt; Add Collaborator</figcaption></figure><h4>Clone repo to local machine</h4><p>Now that you have a collaborator to work with on your specific fork of a repository, it is now time to clone this repo down to your local machine. First, we will go back to the main page of the repo, click the green ‘Clone or download’ button, copy the secure link so we will be able to paste it into our local terminal and run the</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*2KiYGC6X3VAHxoEtGWko5g.png" /><figcaption>You can copy the link with the icon on the right or copy hotkeys</figcaption></figure><pre><strong>git clone git@github.com:jstricklin89/hello-world.git</strong></pre><p>Once you run git clone and paste the link you will see the details of the copy and can then cd [your repo] and hit enter to be in the repo directory. The person you are collaborating with have to follow the same steps here.</p><h4>Check out a branch</h4><p>Branches are a central feature of git that can really be useful for most collaboration. <em>A good practice here is to have one person work in a branch and your teammate work in the local master.</em> This will simplify the process of merging each others code together. Since you now have a local copy of the master branch from the clone process your terminal should show something similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*HfsfLP-PWiVQCRngvSUizA.png" /><figcaption>Branch user: Notice ‘master’ in red. This is your local master copy of the repo.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*UZRg4rjIcCyBa9oELw-p1Q.png" /><figcaption>Branch user: Notice my new branch I created in red with the ‘git checkout’ command</figcaption></figure><p>Now you can use the git checkout -b [your branch] to create a new branch for the repo. Naming is important for this so your partner knows what you were trying to accomplish under this branch. We will also be doing add/commits in a minute, so the naming of the branch will be a little more broad, and the commits will be more specific.</p><h4>Making a commit</h4><p>Now that we are under our branch I am going to create a couple basic methods just like the branch states. Remember, either partner can work out of the local master, but one should be in a branch to create a cleaner method to merge code together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*L6L8vIHWGGBTahcm4lkokw.png" /><figcaption>Branch user: Here is a first commit from branch. The push here placed my changes as a branch in GitHub.</figcaption></figure><p>The git add . combined with the gitcommit -m &quot;message&quot; you see above has made a commit to my branch with a detailed comment of what I have done. I am now able to git push this branch so it will populate online in GitHub, allowing my partner to git fetch my branch and git merge my changes. Lets see how this works below.</p><h4>Performing a fetch, merge, commit, and push to origin master</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*3FvIKmqN0-X7zYlnFaw4Mw.png" /><figcaption>Master user: Git fetch and merge allowed my partner to retrieve my branch and all the changes within that committed branch.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*8QchFQokOaKy1619CchexA.png" /><figcaption>Master user: My partner is working in their local master and is pushing all changes to origin master.</figcaption></figure><p>So now my partner has:</p><ol><li>git fetch and git merge to merge all my changes with their local master.</li><li>git add . and git commit -m &quot;message&quot; to commit all changes.</li><li>git push origin master to take all combined changes from my branch and their local master and push to the origin master production file.</li></ol><h4>Updating my branch with origin master</h4><p>Now that the origin master is fully updated with all changes, I am able to bring them all back down to my branch so I can see and work with all the completed changes thus far.</p><p>One thing to note here: It is not good practice to continue using the same branch after you have pushed from that branch once before. This can create unexpected merge conflicts on your next push. So lets go to our local master to delete our old branch and create a new one. Now we can pull from origin master. Lets see how this looks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*bCaMxi9IhGTcZAgYHzdzBw.png" /><figcaption>Delete old branch, create new branch.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*RX3bpx_fkp2t3gwUAhRSbQ.png" /><figcaption>Pull all updated code from origin master to new branch.</figcaption></figure><p>At this point when I go to look at my individual files, I can see all the code I have created and all my partners code, all combined.</p><h4>Final thoughts</h4><p>If you continue to have one user work in a branch and another user work from their local master, this same process can be repeated as many times as you need until the project is complete!</p><p>Please remember different people work in different ways. I was struggling to find a way to collaborate via Git/GitHub, and this was the method that ended up working best for me.</p><h4>Helpful Links</h4><p><a href="https://git-scm.com/doc">https://git-scm.com/doc</a> — This is a main page for all git documentation. I used this to reference all the commands that can be used locally.</p><p><a href="https://guides.github.com/introduction/flow/">https://guides.github.com/introduction/flow/</a> — This is an interactive flow diagram from GitHub, I found this to be VERY helpful.</p><p><a href="https://guides.github.com/">https://guides.github.com/</a> — Here are all the guides from GitHub. Also very helpful for anything related to GitHub.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34229a4438e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>