<?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[Program Practical - Medium]]></title>
        <description><![CDATA[Easy to digest post to help make you a better programmer. - Medium]]></description>
        <link>https://medium.com/program-practical?source=rss----405e3ca0e94c---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Program Practical - Medium</title>
            <link>https://medium.com/program-practical?source=rss----405e3ca0e94c---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 03:15:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/program-practical" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Offering downloads without giving away the cow]]></title>
            <link>https://medium.com/program-practical/offering-downloads-without-giving-away-the-cow-910998abf21?source=rss----405e3ca0e94c---4</link>
            <guid isPermaLink="false">https://medium.com/p/910998abf21</guid>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[rails]]></category>
            <dc:creator><![CDATA[Nic Ollis]]></dc:creator>
            <pubDate>Wed, 22 Feb 2017 15:02:02 GMT</pubDate>
            <atom:updated>2017-02-22T15:02:01.783Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*jUZLYMCUHw4Q8eg-k-6tyA.jpeg" /></figure><p>So I had an interesting user story the other day. I was asked to implement a new system that would allow users to pay for and download some of our templates.</p><p>This is all pretty well and easy thanks to Stripe and their Rails API. However we needed a way to allow users to download the templates using a key that expires a week after purcahse and doesn’t provide the user with the storage URL of the template. So thats what I wanted to show a way you can provide the download without giving away the proverbial cow.</p><p>Starting off with this we are going to assume a few things. We are using Ruby on Rails, Uploading is done via CarrierWave (although most of what we will show it doesn’t matter), and we are using Pundit for Authorization.</p><p>Let’s first talk about the routes we will be working with. Our coding is pretty easy. For the scope of this post we will just focus on the download page logic and nothing to do with purchaing.</p><ul><li>/template/:id/download/:purchase_key # Secured page with download buttons</li><li>/template/:id/download/:purchase_key/[pdf/psd] # route responsaible for serving up the requested document</li></ul><pre>resources :template, only [:show, :update] do<br>  resources :download, only [:show] do<br>    collection do<br>      get &#39;:id/pdf&#39; =&gt; download#pdf, as: :pdf<br>      get &#39;:id/psd&#39; =&gt; download#psd, as: :psd<br>    end<br>  end<br>end</pre><p>With the routes shown above we should be linked to our controller where all the action happens. First thing we will want to do is ensure the use has a valid key to even be on our downloads page.</p><p>before_action :find_purchase</p><pre>def find_purchase<br>  unless  (@purchase = PurchaseRecord.find_by(key: param[:id])<br>    flash[:error] = &quot;Can&#39;t find purchase.&quot;<br>    redirect_to template_path<br>  end<br>end</pre><p>This is a quick and easy check for the purchase record and if one is not found we just send the user somewhere else. However if one is found we make it an instance varable so we have access to it in the rest of our calls.</p><p>It’s also worth noting we will be using pundit for authorizing the downloads. All pundit is doing is verifying the purchase experation date has not passed if so we do a simlar redirect like above but with a flash message that reflects the expired key.</p><p>Now for the part you have probably scrolled down to the bottom to get to as my rambling has gotten the best of you.</p><p>To do the secure download we can use a few different methods. The easiest would be either send_data or send_file. I prefer send_data as we can just stream the data to the user. If we go with the send_file method we would need to download the template to our server via a tmp file then send that over. To me this seems like wasted stress on the system.</p><p>As we have two methods that need to use simliar code I decided to dry it out with its own method that they both can call. An example for the PSD would be.</p><pre>def psd<br>  authorize @purchase<br>  send_template @purchase.psd_template.url, @purchase.psd_template_identifier<br>end</pre><p>This sends our private url and the file name over to the method send_template to handle the buffer. Sending via the buffer is extremely easy.</p><pre>def send_template(url, filename)<br>  data = open(url)<br>  send_data data.read, filename: filename, disposition: &#39;inline&#39;, stream: &#39;true&#39;, buffer_size: &#39;4096&#39;<br>end</pre><p>With this method we now have an easy way to send the file over without the user ever seeing the real url of the file. While we take a small hit to facilitate the download over all its not to bad for the security of the file. If we also decide for more analitics we can also add in a tracker to the psd and pdf methods so we can track how often they are being downloaded and get some alalitics on our downloads that we couldn’t get before with the old method of giving the users links that we didn’t control.</p><p>As a bonus if you are using CarrierWave with something like S3 storage you can override the fog_public method in your PDF/PSD uploaders to make the files private in your bucket to only allow your server to grab them.</p><pre>def fog_public<br>  false<br>end</pre><p>By putting this method in just your uploader your other uploaders like avatar and general images wont be locked down as they would be if you made this change in the CarrierWave documentation.</p><p>As always thanks for reading, and follow me on <a href="https://twitter.com/nic_ollis">twitter</a> for more daily updates, live stream alerts, and post on my journey of software development. Subscribe to the Program Practical channel on <a href="https://www.youtube.com/c/Programpracticaltv">YouTube</a>. Feel free to ask any questions in the comments below, and don’t forget it’s always a good time to start to #LearnToCode</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=910998abf21" width="1" height="1" alt=""><hr><p><a href="https://medium.com/program-practical/offering-downloads-without-giving-away-the-cow-910998abf21">Offering downloads without giving away the cow</a> was originally published in <a href="https://medium.com/program-practical">Program Practical</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Program Practical’s new home!]]></title>
            <link>https://medium.com/program-practical/program-practicals-new-home-e8dd9fa5b463?source=rss----405e3ca0e94c---4</link>
            <guid isPermaLink="false">https://medium.com/p/e8dd9fa5b463</guid>
            <category><![CDATA[medium]]></category>
            <dc:creator><![CDATA[Nic Ollis]]></dc:creator>
            <pubDate>Tue, 07 Feb 2017 06:40:21 GMT</pubDate>
            <atom:updated>2017-02-07T06:34:09.577Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey guys! Thanks for following me on Medium.</p><p>I wanted to catch up with you guys and anyone who follows my blog on programpractical.com. With my current contract coming to an end. I decided hosting my own server and wordpress account was just taking up too much time and fighting for views is not worth what I was getting via Medium.</p><p>As of now programpractical.com is a dead page, until I get the last bit of info I need from Medium to have it properly going to their site(bad planning on my part). However, Program Practical is now a publication on Medium! <a href="https://medium.com/program-practical">https://medium.com/program-practical</a></p><p>Anything I post will be published on there, but I’ll also be looking for other medium programmers to publish to it, so please feel free to follow as I’ll be trying to bring in more than just my voice. As well feel free to submit stuff yourself!</p><p>Again thanks guys for the support and I’ll see you guys in youtube and medium again here soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8dd9fa5b463" width="1" height="1" alt=""><hr><p><a href="https://medium.com/program-practical/program-practicals-new-home-e8dd9fa5b463">Program Practical’s new home!</a> was originally published in <a href="https://medium.com/program-practical">Program Practical</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Experience and Advice from a Newbies First Hackathon]]></title>
            <link>https://medium.com/program-practical/experience-and-advice-from-a-newbies-first-hackathon-d16010d586bd?source=rss----405e3ca0e94c---4</link>
            <guid isPermaLink="false">https://medium.com/p/d16010d586bd</guid>
            <category><![CDATA[indiana]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[hackathons]]></category>
            <dc:creator><![CDATA[Nic Ollis]]></dc:creator>
            <pubDate>Tue, 07 Feb 2017 06:24:10 GMT</pubDate>
            <atom:updated>2016-03-04T03:43:51.643Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z9Y9l2NM6r9ZkgCtEISA5g.jpeg" /></figure><p>This last weekend I got to participate in #INCapitolHack. A hackathon to help create solutions for the city of Indianapolis Indiana. This was my first hackathon and I wanted to share some of my experience with other working-to-be developers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*siNpRd4RUBNqdgkqixZzYA.jpeg" /></figure><p>The event started Friday night with an overview of the event to come and team creation time. One of the biggest thing I will say is get on a team before the event. This might seem a hard task if you’re like me and are new to social development and only been to a meetup or two. My advice here is go social. I sent out messages on twitter, flowdock, and meetup asking if anyone from the local Ruby group would be attending the hackathon. I ended up messaging a fellow I met at the Bloomington ruby meetup when I saw him RSVP’d to the event on another meetup page. He had also found someone on meetup and we had our team.</p><p>The reason why I say doing use the help of the hackathon to get on a team is because I overheard the organizers the next day talking about creating teams the day before. In one guy’s words “I just put all the dead weight on one team”. I find this is horrible as hopeful developers can learn a lot of experienced ones in hackathons and while they might be “dead weight” split around evenly you can really help the tech community grow. Something they were claiming to do.</p><p>As for the mindset of “I don’t know enough to do this”. If you know some front end stuff including HTML and CSS then you can be helpful. Going in I have never touched any part of the MEAN stack, however that is what we were going with. I stayed up late the first night getting my laptop ready for the next day as the team chatted on Slack, and looked through some of the aspects of the MEAN stack.</p><p>The key here is having someone on your team who is experienced, and allowing them to pick the development stack as they can really be a team leader and help in your 24-hour crash course into this new tech. As well if you created the team early enough before the event you can all be team programing and learning the stack before the event.</p><p>However, after the event was over, we might not have one but we made new friends and learned new technology. As well for me I gained the confidence that I can learn quickly and become competent enough in start producing in a short amount of time in a new stack. This has pushed me enough to know I can survive as a Jr. Developer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*96TQ9FE19Z7LuU4ZCYtGGw.jpeg" /></figure><p>I can’t stress it more, if you’re trying to become a developer, get out and go to hackathons. The experience in team work, deadlines, knowledge, and producing under stress is unmatched in anything else you can get in a short 24-hour timespan.</p><p>As always thanks for reading find more on my blog at <a href="http://programpractical.com/">Program Practical</a>, and follow me on <a href="https://twitter.com/nic_ollis">twitter</a> for more daily updates and post on my journey from Senior IT Admin to Junior Developer. Feel free to ask any questions in the comments below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d16010d586bd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/program-practical/experience-and-advice-from-a-newbies-first-hackathon-d16010d586bd">Experience and Advice from a Newbies First Hackathon</a> was originally published in <a href="https://medium.com/program-practical">Program Practical</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fears of a New Job]]></title>
            <link>https://medium.com/program-practical/fears-of-a-new-job-94f1f775da5a?source=rss----405e3ca0e94c---4</link>
            <guid isPermaLink="false">https://medium.com/p/94f1f775da5a</guid>
            <dc:creator><![CDATA[Nic Ollis]]></dc:creator>
            <pubDate>Thu, 04 Aug 2016 19:38:14 GMT</pubDate>
            <atom:updated>2017-02-07T06:09:19.835Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="14419542738_75111193a9_b" src="https://cdn-images-1.medium.com/max/1024/0*MJ70wEF1YgDF019x.jpg" /></figure><p>I have found while I really enjoy programming full time. It has also brought on some anxiety I was not expecting. I had been up until July a full time IT administrator for a little over 5 years. In this job while still learning a lot the majority of what I did on a day to day basis was memorized and required little to no effort.</p><p>It has been string moving into a job that while I still knew enough that after a trial run with the company they still wanted to hire me. I find my self outside my knowledge sphere on a daily basis. I love this as I’m currently learning so much. I have a few blog post / videos on the way about what I’ve learned in ActionMailer and Google Client API for Ruby as a result of what all I have been learning.</p><p>However, its still an odd place to be in where everyday you don’t feel like you know enough because you are learning so much and reading a lot of documents. I did feel a bit better after talking to my boss and he mentioned I had been doing great work on getting a feature implemented. As well, while listening to the Talk Python to Me podcast. They had mentioned that even after being on the job for 3 months in most projects you still would be new and not know good portions of the code base.</p><p>Main thing I’m trying to get at for new developers (like me) is, it’s okay. Its a new job and I’m sure you are doing a great job. Even if you feel like you should have caught that typo 30 minutes ago and want to pull your hair out. As long as your learning from all the ups and downs you’ll be okay.</p><p>As well you might not be in the same boat as me. I am working my first job remotely so I don’t have day to day interaction with developers and 60%-70% of my communication is done via text, with me on a timezone difference of 3–6 hours depending on who I need to talk to.</p><p>I’ll end on this note though, I’m so happy to be in a position that I am learning everyday, doing what I love. I wouldn’t trade it for any other line of work.</p><p>As always thanks for reading, and follow me on <a href="https://twitter.com/nic_ollis">twitter</a> for more daily updates, live stream alerts, and post on my journey from Senior IT Admin to Junior Developer. Subscribe to the Program Practical channel on <a href="https://www.youtube.com/c/Programpracticaltv">YouTube</a>. Feel free to ask any questions in the comments below, and don’t forget it’s always a good time to start to #LearnToCode</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94f1f775da5a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/program-practical/fears-of-a-new-job-94f1f775da5a">Fears of a New Job</a> was originally published in <a href="https://medium.com/program-practical">Program Practical</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making your first push in git]]></title>
            <link>https://medium.com/program-practical/making-your-first-push-in-git-cbb453d40018?source=rss----405e3ca0e94c---4</link>
            <guid isPermaLink="false">https://medium.com/p/cbb453d40018</guid>
            <dc:creator><![CDATA[Nic Ollis]]></dc:creator>
            <pubDate>Mon, 06 Jun 2016 06:00:16 GMT</pubDate>
            <atom:updated>2017-02-07T06:09:06.219Z</atom:updated>
            <content:encoded><![CDATA[<p>Making your first push to a project can be a daunting task if you are new to git. Today we are going to review how I do my checks before pushing and what you can do to avoid making mistakes prevalent to newbies.</p><p>For me my first step is always running a git status. I do this so I can get a quick list of files that have been added/modified/deleted. When I code I might put a binding.pry in a file I made no other edits to for troubleshooting and if I see the file in the list it&#39;s a good reminder to open the file and remove my changes.</p><p>Next we jump into a more detail view git diff, will show you all the changes git has registered. Review each line in detail. Make sure you don&#39;t have any commented out code that needs removed, or anything like binding.pry that needs removed. What you see in git diff is what will show on your pull request so make sure you won&#39;t be embarrassed by anything on it.</p><p>Now that we have all out changes staged and looking good I like to run git add . and git commit -am &quot;&lt;message&gt;&quot; the -a on git commit will make sure you remove any deleted files.</p><p>Don’t do your push just yet, we need to make sure nothing has changed on the master branch that could break our code. For this I take a multistep approach, although it could be narrowed down a bit to be more efficient. First I jump back to my local master branch git checkout master then I pull down the remote master git pull.</p><p>If changes were pulled down follow this next step otherwise jump to the next paragraph. I then jump back over to my working branch git checkout nic/working-branch and then run a git merge master. The merge will let you know of any conflicts, open any conflicted files and handle the issues as they come up. To leave the commit message screen that opens in vim by default hit :wq and enter on your keyboard. Now our run your test one more time to make sure no changes broke your code.</p><p>At this point we have all our changes committed locally and our branch is up to date with everything on the master branch. Next we just need to push the code up to the repository. Best practice it to push the code using your branch so project controllers can test your code easily. git push origin nic/working-branch will push our working branch up to the origin. From here we can log into github and build our pull request!</p><p>So to summarize with a quick list.</p><ul><li>git status and git diff</li><li>git add . and git commit -am ‘message’</li><li>git checkout master and git pull</li><li>git checkout nic/working-branch and git merge (if needed)</li><li>git push origin nic/working-branch</li><li>login to github and make pull request</li></ul><p>As always thanks for reading, and follow me on <a href="https://twitter.com/nic_ollis">twitter</a> for more daily updates, live stream alerts, and post on my journey from Senior IT Admin to Junior Developer. Subscribe to the Program Practical channel on <a href="https://www.youtube.com/c/Programpracticaltv">YouTube</a>. Feel free to ask any questions in the comments below, and don’t forget it’s always a good time to start to #LearnToCode</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbb453d40018" width="1" height="1" alt=""><hr><p><a href="https://medium.com/program-practical/making-your-first-push-in-git-cbb453d40018">Making your first push in git</a> was originally published in <a href="https://medium.com/program-practical">Program Practical</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blocks, Procs, Lambdas, oh my!]]></title>
            <link>https://medium.com/program-practical/blocks-procs-lambdas-oh-my-8c636a54757c?source=rss----405e3ca0e94c---4</link>
            <guid isPermaLink="false">https://medium.com/p/8c636a54757c</guid>
            <dc:creator><![CDATA[Nic Ollis]]></dc:creator>
            <pubDate>Mon, 30 May 2016 18:55:43 GMT</pubDate>
            <atom:updated>2017-02-07T06:08:57.309Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FPNcgUuURw6I%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPNcgUuURw6I&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FPNcgUuURw6I%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0405d260fde83d774b682a2154d07157/href">https://medium.com/media/0405d260fde83d774b682a2154d07157/href</a></iframe><p>Today I wanted to go over Blocks, Procs, and Lambdas in Ruby via a easy and short over view. There are a lot of post on the subjects already so I am hoping to just give a high level overview to get your interest peaked on some of the most interesting parts of the Ruby language.</p><p>Above is my last video going over Blocks and how to use them so I will keep my blocks in here short.</p><p>To overly simply what these are in a way that will probably upset more senior developers:</p><ul><li><strong>Blocks: </strong>Chunks of code that will be ran in the parent method that dynamically changes the logic and results of the method.</li><li><strong>Procs: </strong>Much like Blocks but stored as a variable, and can be passed into functions like a variable</li><li><strong>Lambdas: </strong>A step closer to being full on functions than Procs, but are anonymous in their naming.</li></ul><p>Ranking them in likely to be used:</p><ul><li><strong>Blocks: </strong>Used all the time; Good luck avoiding them</li><li><strong>Procs: </strong>Not used as much, but can be helpful in a when using shared logic</li><li><strong>Lambdas: </strong>Rarely used</li></ul><p>So jumping into some examples Blocks in conjunction with the yield keyword give you an ability to dynamically change logic happening in the middle of a function. One I’m sure you have come across even if your highly new to programming is the .each function used with arrays or ranges.</p><p>What happens here is the .each is managing your loop for you and in each iteration is giving you the current variable its on in the loop and allowing you to do what you want to it. Then when control is handed back to the .each method it continues on with the loop.</p><p>Again see the video above if you would like to see Blocks in action.</p><p>I like to think of Procs as pointers to a function, although pointers are seem more in languages like C++ I believe it fits because of how they are used. Procs are great ways to pass commonly used blocks around in keeping in line with DRY logic. For example if I wanted to have a Proc that prints out the instance variable I would do something like below.</p><p>my_new_proc = Proc.new { |x| puts x }</p><p>I can easily use this now in any method that takes a block.</p><p>(0..9).each(&amp;my_new_proc)</p><p>Take note of the ampersand before the variable name. In C++ this would be how you call the address of a variable in memory. This would be why I say this reminded me of a pointer to a function in C++ as it would be used in a very similar manner. All you need to remember though is when using a Proc use an ampersand.</p><p>Finally we will do a quick look into Lambdas. I like to think of Lambdas as anonymous functions much like you see in JavaScript but they are a bit more strict. Two things to know about Lambdas is you can return variables from them, something you can’t do in Procs but can in functions. Next, they are very strict about the number of arguments you pass in. Procs don’t care if you pass in more than you should have, but Lambdas will throw an error if the number of arguments are off.</p><p>a = lambda do |x,y|<br>puts x + y<br>return x - y<br>end.call(3,5)<br>console output: 8<br>a = -2</p><p>So here we define a lambda by using the keyword lambda and giving it a block of code. To we told it to expect two variables and to output to the console and return a number to a variable. Note we had to chain the method .call to the end of the block to fire the method off. As well we passed in the variables in the call method. This would be because our lambda is not method association and we have no way to call the lambda after its defined so we had to call it after we ended its block of code.</p><p>As you should be able to see Lambdas are interesting but don’t have much of a place in most the code you will write.</p><p>As always thanks for reading, and follow me on <a href="https://twitter.com/nic_ollis">twitter</a> for more daily updates, live stream alerts, and post on my journey from Senior IT Admin to Junior Developer. Subscribe to the Program Practical channel on <a href="https://www.youtube.com/c/Programpracticaltv">YouTube</a>. Feel free to ask any questions in the comments below, and don’t forget it’s always a good time to start to #LearnToCode</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c636a54757c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/program-practical/blocks-procs-lambdas-oh-my-8c636a54757c">Blocks, Procs, Lambdas, oh my!</a> was originally published in <a href="https://medium.com/program-practical">Program Practical</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Skeleton Ruby Project: Mac Edition]]></title>
            <link>https://medium.com/program-practical/skeleton-ruby-project-mac-edition-1c62f401e469?source=rss----405e3ca0e94c---4</link>
            <guid isPermaLink="false">https://medium.com/p/1c62f401e469</guid>
            <dc:creator><![CDATA[Nic Ollis]]></dc:creator>
            <pubDate>Mon, 23 May 2016 16:00:05 GMT</pubDate>
            <atom:updated>2017-02-07T06:09:04.077Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Screen Shot 2016-05-22 at 3.21.58 PM" src="https://cdn-images-1.medium.com/max/568/0*XzWCPeHuWx2t3M7A.png" /></figure><p>A nice thing to have in your Ruby journey will be a skeleton project so you can quickly get up and running when you need to create a new project. We have done this project in an earlier post for computers running Windows. However, with the upcoming video series on algorithmic challenges in Ruby I wanted to translate the old post for Mac systems. We will be doing all the commands in the terminal, and the Atom editor for writing to the files.</p><p>First we will create our skeleton project folder and its sub folders.</p><pre>mkdir skeleton</pre><pre>cd skeleton</pre><pre>mkdir bin data doc ext lib tests lib/PROJECT</pre><p>Now with our folder structure of project in place we will just need to create the template files. The commands are:</p><pre>touch bin/PROJECT</pre><pre>touch lib/PROJECT.rb</pre><p>This will create an places we can start putting our new projects code. Next we will want to make a simple gemspec file that will hold the details of our project. We will name this PROJECT.gemspec and it will be located in our root project directory.</p><pre>touch PROJECT.gemspec</pre><pre>atom ./PROJECT.gemspec</pre><p>PROJECT.gemspec file contents:</p><pre># coding: utf-8<br>lib = File.expand_path(&#39;../lib&#39;, __FILE__)<br>$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)</pre><pre>Gem::Specification.new do |spec|<br>  spec.name          = &quot;PROJECT&quot;<br>  spec.version       = &#39;1.0&#39;<br>  spec.authors       = [&quot;Your Name Here&quot;]<br>  spec.email         = [&quot;youremail@yourdomain.com&quot;]<br>  spec.summary       = %q{Short summary of your project}<br>  spec.description   = %q{Longer description of your project.}<br>  spec.homepage      = &quot;http://domainforproject.com/&quot;<br>  spec.license       = &quot;MIT&quot;</pre><pre>spec.files         = [&#39;lib/PROJECT.rb&#39;]<br>  spec.executables   = [&#39;bin/PROJECT&#39;]<br>  spec.test_files    = [&#39;tests/test_PROJECT.rb&#39;]<br>  spec.require_paths = [&quot;lib&quot;]<br>end</pre><p>After the gemspec file is done we will want to create our Rakefile to help us with automating common task when working with Ruby. This Rakefile will be used to help run our test.</p><pre>touch Rakefile</pre><pre>atom ./Rakefile</pre><p>Rakefile file contents:</p><pre>require &#39;rake/testtask&#39;</pre><pre>Rake::TestTask.new do |t|</pre><pre>t.libs &lt;&lt; &quot;tests&quot;</pre><pre>t.test_files = FileList[&#39;test/test*.rb&#39;]</pre><pre>t.verbose = true</pre><pre>end</pre><p>Finally we will want to make a simple test file to finish up our skeleton project</p><pre>touch tests/test_PROJECT.rb</pre><pre>atom ./tests/test_PROJECT.rb</pre><p>test_PROJECT.rb contents:</p><pre>require &quot;./lib/PROJECT.rb&quot;</pre><pre>require &quot;test/unit&quot;</pre><pre>class TestName &lt; Test::Unit::TestCase</pre><pre>def test_sample</pre><pre>assert_equal(4, 2+2)</pre><pre>end</pre><pre>end</pre><p>Now we should have our test project all finished up. You can test your project by calling “rake test” from your project’s root directory. If setup correctly you should get a passed test without any failures or errors. Below is the file structure you should have now.</p><pre>skeleton/</pre><pre>PROJECT.gemspec</pre><pre>Rakefile</pre><pre>data/</pre><pre>ext/</pre><pre>tests/</pre><pre>test_NAME.rb</pre><pre>bin/</pre><pre>PROJECT</pre><pre>lib/</pre><pre>PROJECT</pre><pre>PROJECT.rb</pre><p>Now when you want to use this to creating a new project all you will need to do is the following.</p><ul><li>Copy the skeleton project and rename the root folder to your new project name</li><li>Rename the lib/PROJECT.rb file and the lib/PROJECT folder to the new project name</li><li>Edit the Gemspec file to fit the new project</li><li>rename and tests/test_PROJECT.rb and make sure to edit the ‘require “./lib/PROJECT.rb”’ inside that test file</li><li>Double check everything is working by calling “rake tests”.</li><li>Happy Coding!</li></ul><p>As always thanks for reading, and follow me on <a href="https://twitter.com/nic_ollis">twitter</a> for more daily updates, live stream alerts, and post on my journey from Senior IT Admin to Junior Developer. Subscribe to the Program Practical channel on <a href="https://www.youtube.com/c/Programpracticaltv">YouTube</a>. Feel free to ask any questions in the comments below, and don’t forget it’s always a good time to start to #LearnToCode</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c62f401e469" width="1" height="1" alt=""><hr><p><a href="https://medium.com/program-practical/skeleton-ruby-project-mac-edition-1c62f401e469">Skeleton Ruby Project: Mac Edition</a> was originally published in <a href="https://medium.com/program-practical">Program Practical</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When to start looking for a job]]></title>
            <link>https://medium.com/program-practical/when-to-start-looking-for-a-job-8b5a08579b39?source=rss----405e3ca0e94c---4</link>
            <guid isPermaLink="false">https://medium.com/p/8b5a08579b39</guid>
            <dc:creator><![CDATA[Nic Ollis]]></dc:creator>
            <pubDate>Mon, 16 May 2016 16:00:30 GMT</pubDate>
            <atom:updated>2017-02-07T06:09:14.496Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="1af58f6eb3b170c75aca8f3d7152502f9d2f109d38eaaa9cba4e696ec6562254" src="https://cdn-images-1.medium.com/max/600/0*rRpZwydPGAPL6bXS.jpg" /></figure><p>One question I hear a lot and have even asked myself a while back ago is “When do I know enough to start looking for a job”. While this question is very complicated and depends on a lot of factors I wanted to go into my background a bit and what got me to the point of saying “I know enough”.</p><p>Like I’ve mentioned in the past I have about 5 years of hobbyist programming under my belt but until recently I have not really had much to show for it. Mostly due to a lack of discipline and not staying in a stack long enough to learn the amount needed to get a job.</p><p>Typically if you look at boot camps and online courses they have you go though and make at least 6 sample projects to show off on your own website. I think this is a great as it gives you a lot of experience and a lot to show off in interviews. My only warning is don’t do the same thing over again. For instances if you are wanting to get into website programming. Make your <a href="http://ollis.me/">portfolio</a>, an app that uses <a href="http://codepen.io/nollis/pen/eJMomR">API’s like Wikipedia</a>, maybe a small game like <a href="http://ollis.me/simon/">Simon </a>(this has gotten praise at interviews before), and more diversity depending on what kind of projects interest you. Same applies if you are looking for Android programming or even Game Programming. If you want a job making mobile apps, first start making apps to show you know your stuff.</p><p>This will give you a solid foundation, and proof you know your stuff. While you still wont be an expert you should have enough to land an entry job depending on where you are.</p><p>However, if you are like me you might still be worried. I have always been odd with my self esteem and worried while I feel I know a lot about programming, would I be able to keep up in a team environment with deadlines?</p><p>The big vindication for me was participating in my first hackathon. During the hackathon we used the MEAN stack. The only technology I have used in the MEAN stack up to this point was JavaScript and to my surprise we used TypeScript instead of JavaScript so I was really out of water on this. So to give me somewhere I could work I asked to be on the front end, as although I didn’t know Angular JS at the time, I could do HTML, CSS, and limp my way though TypeScript.</p><p>I am happy to say I was able to pickup enough on the technology pretty quickly to contribute features and code to the front end. Being able to be throw into a new tech stack and in 24 hours be able to churn out code was the confidence boost I needed to feel like I could take on a programming job and not completely fail on day one.</p><p>However, I do have some warnings with hackathons. Find a team before the event. I was lucky and met a very nice guy at the Ruby meetup in town that was going to be at the hackathon and he got me on his team who had an experience developer who was just looking to have a good time and didn’t mind looking over the new guys.</p><p>While I didn’t know the guy from the Ruby meetup other than our one conversation, that was enough to get onto a team that did some great things. I say this because I over heard the people who helped find teams for coders say they put all the “dead weight” on one team to let it sink. Its very sad as I feel hackathons should be for community development more then the outcomes of the projects. A whole team of people excited to get into coding ended up getting a horrible experience that could have very well killed their desire in coding.</p><p>To wrap up what has turned into a ramble. Pick your platform of choice and make 6 unique apps / sites that all have their own features. Don’t be afraid to clone, they are just example projects. Go to a hackathon, or a local meetup on a night they might be doing a coding project. Main thing is don’t go to a hackathon alone. Ask around a meetup group and see if anyone else is going and if they have room on their team for one more. At the end of the day coding skills are important, but your confidence in learning new skills quickly will determine your success in an ever changing technology world.</p><p>As always thanks for reading, and follow me on <a href="https://twitter.com/nic_ollis">twitter</a> for more daily updates, live stream alerts, and post on my journey from Senior IT Admin to Junior Developer. Subscribe to the Program Practical channel on <a href="https://www.youtube.com/c/Programpracticaltv">YouTube</a>. Feel free to ask any questions in the comments below, and don’t forget it’s always a good time to start to #LearnToCode</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b5a08579b39" width="1" height="1" alt=""><hr><p><a href="https://medium.com/program-practical/when-to-start-looking-for-a-job-8b5a08579b39">When to start looking for a job</a> was originally published in <a href="https://medium.com/program-practical">Program Practical</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated Code Review in Ruby]]></title>
            <link>https://medium.com/program-practical/automated-code-review-in-ruby-ec4a2b7b19e3?source=rss----405e3ca0e94c---4</link>
            <guid isPermaLink="false">https://medium.com/p/ec4a2b7b19e3</guid>
            <dc:creator><![CDATA[Nic Ollis]]></dc:creator>
            <pubDate>Mon, 09 May 2016 16:00:02 GMT</pubDate>
            <atom:updated>2017-02-07T06:09:39.388Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="rubocop" src="https://cdn-images-1.medium.com/max/765/0*fwKpVogadzwhywxj.png" /></figure><p>Today I wanted to review automating code review inside of ruby.<br>Their meeting great open source projects to help make sure you are sticking to an idiomatic way of coding in ruby. The main one I will focus on today is Robocop and Robocop-git.</p><p><a href="https://github.com/bbatsov/rubocop">Rubocop </a>is an open source gym for ruby that will review your project and let you know of any “best practices” you are not adhering too. As described on the Rubocop github page. Out of the box it will enforce guidelines set by the <a href="https://github.com/bbatsov/ruby-style-guide">Ruby Style Guide</a>.</p><p>Best of all, not only will it report problems to you, but using the -a flag it can even auto correct many of the problems it fined.</p><p>Rubocop is extremely easy to install just run gem install rubocop from there you can easily run rubo cop on your project by just running rubocop in your terminal in the root of your project.</p><p>Rubocop can be a great tool for you to run on a project to try an help contribute when you are a new comer and still learning your way around ruby. However, don’t just go editing without thought. Sometime we might use fail instead of rescue because it looks better when reading. However, Rubocop wont know that and still tell you to correct it. This might lead to your efforts of helping out an open sourced project being shot down. Moral of the story, don&#39;t get to trigger happy just because Rubocop says it should be changed.</p><p>However, one issue is you might be working in a very large project and you don’t want to run rubocop on the whole project due to the time / complexity of the results. You might also just want to run Rubocop on the code changes you made.</p><p>For this project we have the project <a href="https://github.com/m4i/rubocop-git">Rubocop-git</a> this is just an addition on top of rubocop. However, in this project it will parse your git diff data and only show you issues on the code you have changed. This is great for when you are just wanting to run a quick check on the code you contributed to make sure it wont get sent back for something silly as using some outdated method name / convention.</p><p>I personally have contributed to the rubocop-git project, although at the time of writing this it has still not been pulled into the master branch. I added the autocorrect flag -a found in the normal rubocop project back into the rubocop-git project. If you would like to start using this feature before it gets pulled into the master feel free to download the project on <a href="https://github.com/nicollis/rubocop-git">my repo</a>.</p><p>As a new developer I highly recommend using one of these gems while you are still learning the ropes to help you get productive quickly and not get things shot down because they didn’t conform to the style guidelines.</p><p>As always thanks for reading, and follow me on <a href="https://twitter.com/nic_ollis">twitter</a> for more daily updates, live stream alerts, and post on my journey from Senior IT Admin to Junior Developer. Subscribe to the Program Practical channel on <a href="https://www.youtube.com/c/Programpracticaltv">YouTube</a>. Feel free to ask any questions in the comments below, and don’t forget it’s always a good time to start to #LearnToCode</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec4a2b7b19e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/program-practical/automated-code-review-in-ruby-ec4a2b7b19e3">Automated Code Review in Ruby</a> was originally published in <a href="https://medium.com/program-practical">Program Practical</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Live on YouTube]]></title>
            <link>https://medium.com/program-practical/live-on-youtube-a1b88462fbab?source=rss----405e3ca0e94c---4</link>
            <guid isPermaLink="false">https://medium.com/p/a1b88462fbab</guid>
            <dc:creator><![CDATA[Nic Ollis]]></dc:creator>
            <pubDate>Mon, 02 May 2016 22:29:27 GMT</pubDate>
            <atom:updated>2017-02-07T06:09:11.506Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FskYQ1i6JzcY%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DskYQ1i6JzcY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FskYQ1i6JzcY%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/235061cf99650a1d9f410893530a9157/href">https://medium.com/media/235061cf99650a1d9f410893530a9157/href</a></iframe><p>Program Practical is now on youtube. This month I am moving to a bi-media format with blog post going to start coming out weekly on Program Practical, as well weekly video post on YouTube.</p><p>These post will cover a range of programming topics, from progress updates, coding tutorials, and coding news. I will be currently be focused more on Ruby and Rails, but might jump into C++, Python, and other languages depending on my current project or topic request.</p><p>The current videos in the pipeline include a background on my coding past, some code problem solving in C++, and one I’m shooting tonight on making Linked List in Ruby.</p><p>As always thanks for reading, and follow me on <a href="https://twitter.com/nic_ollis">twitter</a> for more daily updates, live stream alerts, and post on my journey from Senior IT Admin to Junior Developer. Subscribe to the Program Practical channel on <a href="https://www.youtube.com/c/Programpracticaltv">YouTube</a>. Feel free to ask any questions in the comments below, and don’t forget it’s always a good time to start to #LearnToCode</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1b88462fbab" width="1" height="1" alt=""><hr><p><a href="https://medium.com/program-practical/live-on-youtube-a1b88462fbab">Live on YouTube</a> was originally published in <a href="https://medium.com/program-practical">Program Practical</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>