bloc referral

If you are interested in learning to code with a mentor, try bloc and get $100 off.

Monday, October 27, 2014

Concentric Circles in Learning

When I was younger one of my least favorite cartoons was the Road Runner.  One of the main reasons that I did not like the cartoon because of Wile E. Coyote. In his effort in catching the Road Runner he never kept at it with the same tools, and always thought he had to try something new.

In the beginning of my learning to program journey, I tried everything. I tried a lot of languages before I finally settled on Ruby. I actually first started with C, but when that got boring I quickly jumped into to Ruby after spending a brief time in HTML/CSS, but years prior I attempted to learn JAVA with much failure.

I also tried a lot of different tools to learn Ruby and built up quite the backlog of things to complete, including books, videos, and course. My thought was to blow through each learning tool quick enough to learn the next, but I very rarely did things twice.

My entire outlook on learning has completely changed now that I work as a web dev, but I feel like it is for the better. I now spend more time on one learning resource at a time and actually find myself revisiting things I have already completed.

I heard of the term, Concentric Circles in Learning from a fellow Odinite, Afshin. The idea comes down to making your learning cyclical by repeating going through learning materials multiple times. My biggest complaint with Code School is that I did not understand the material the first time through. I then avoided learning Rails through the Rails for Zombie course, but when I revisited months later after completing a number of Rails Tutorials, it made much more sense.

One of the biggest recommendations I heard when going through the Rails Tutorial is to go through the same tutorial again. I met an individual at local meetup who loaned me a copy of the The Well-Grounded Rubyist after going through it 3 times. There is a lot of truth to learning more the second time around.

I now actual read books multiple times and repeat chapters as well as complete the problems in the book(Eloquent Javascript). I have been slowly working through Vim Adventures while running my test suite at work and feel VIM has become second nature because of it.

Before I felt like I was cramming for a test before an exam every time I learned something new, I now leisure read through material not worrying about capturing everything in my brain because I can always capture on my second of third time through.



I highly recommend going through resources multiple times and don't give up just take a break.

What are your thoughts on this? Do you re-read and run through videos multiple times or do you try things once?

Friday, October 24, 2014

Change your local host name

Did you know that you can update your host names. For example rather than typing in localhost:3000 to boot up your rails app, you could call up brian:3000.

All you need to do is call up `sudo nano.etc.hosts`and append a new line at the bottom with your the new alias and the reference of 1.27.0.0.1, voila. The only catch is that you need know how move around the NANO editor.

I recommend not replacing localhost but rather just creating an additional alias.

sudo nano /etc/hosts

For more info check out these detailed instructions.

Thursday, October 23, 2014

Practicing Code [Global Day of Code]

A year ago I embarked on a journey into learning how to program. I spent 550 hours of hard work across 7 months towards a goal of being proficient in writing code. The word proficient is very subjective and as I think if I am or not, I think of what areas I need practice in.

I have been playing my entire life, began at the age of 9, and as a musician I understand the importance of practice and trying different things. As many children I group listening to fair bit amount of music but never really got into classic rock and crazy guitar solos until I got into college. It was never an area of music I appreciated until college, but once I discovered that genre, I was able to increase my musical ability exponentially.

I have volunteered to facilitate the Global Day of Code, because just as in music I understand the need for practice to strengthen skills. The Global Day of Code is meant for developer who does not have time to try new things or appreciate other languages because of time constraints and deadlines. Due to these constraints we generally stick to the techniques that we have proven and avoid the risk of trying something new.

If you are looking to get into a new programming language or just strengthening your programming skills, the Global Day of Code is for you.

The structure of the day is broken up into 40 min pairing sessions with different developers throughout the day. There is a very good chance you will pair with a developer who has a different idea of how to write code and solve the problem, which open up the door for you to learn.

The problem laid out for the pairs is Conway's Game of Life and is a fairly straight forward but very unlikely to be completed in 40minutes, during each pairing session a new constraint is provided to challenge the pairs, For example one session I was given the constraint where I person writes test and the others write the code to pass the test, without talking. This was rather difficult since I had never tested in Ruby prior and had the luxury of also pairing with someone using VIM, which I also had no experience with.

The entirety of experience at the code retreat was only 1 month into my journey towards learning code and I still took away a ton of information. It actually began my attempt into testing in Ruby and is the main reason why learned it early in my programming journey.

If you are interested in joining a Code Retreat near I highly recommend and if you are in the Orlando area, I highly recommend joining me on November 15th.

Tuesday, October 21, 2014

One Year Into this.


This happens to be a pretty big milestone week for me. This is actually the week I started learning how to program. I remember waking up in the hospital and having the idea of learning how to program.

A year ago I was only in my first class of my MBA and I wrote my first MBA paper on Google. I had recently got interested in them after reading the book In The Plex. The book got me thinking of starting my own journey into programming and thus began my deep dive, feet first.

I had an idea for an application to search churches based on location. I had previously tried to find a church from google but failed to  find any decent results. I had the idea; I jut had no idea where to begin. I thought about getting into iOS but previously attend Android development years ago but lost interest very quickly after realizing you had to learn JAVA. I decided to start in C programming, since it was the most basic, and I used a free course called Computer Science for Everyone. This course seems to be no longer available on the internet, but I do know it is available in questionable places for torrenting, but I rather not link there.

After 2 weeks of that I blew through the basics of C and Computer Science but stumbled upon a video on youtube about learning Ruby/Rails in only a month. I couldn't jump ship any faster, I love this guys drive to learn so quickly and after a quick read on Ruby, I found it to be significantly easier to read. I signed up for his course and that begin my journey with Ruby.

Learning to code is probably one of the best decisions of my life. It not only gave me a new career but also gave an opportunity to use a multitude of my skills.

I have completed an Apprenticeship, started an online community, and even completed the building of applications. I am definitely excited to see what is store for this next year. 

Wednesday, October 15, 2014

Capybara page.save_screenshot('screenshot.png')

I spent a lot of time trying to fix integration test at work and have experience using the `save_and_open_page` command to view the actual page. This has been an awesome addition to my test debugging, but recently I discovered a new command `page.save_screenshot('screenshot.png')`.

The screenshot command only works with pages and test that use Javascript, and are great to check to see if the functionality is really happening in a controlled environment.

I spent the past weeks working on a filtered search using Sunspot/SOLR which is all new stuff for me. SOLR is basically a tool to do searching of the database and Sunspot is the gem that connects Rails to SOLR easily.

SOLR has specific methods that query the database and I spent a lot of time checking out a number of them and testing the UI to be sure the correct data shows.

I am sure I could of spent the entire time in the terminal testing functionality but using my integration test and the Capybara screenshot command to view the actual page was a little more rewarding.

If you have integration test I highly recommend using Capybara to debug integration testing. I wrote this post to remind myself of the syntax, since I literally google it every time I need to use it.

*UPDATE: the screenshot call only works if you enable javascript in your test, with something like selenium:

 `def switch_to_javascript
    Capybara.javascript_driver = :selenium if ENV["FF"]
    Capybara.current_driver = Capybara.javascript_driver
  end
'

Thanks Adam Brice for pointing that out.

Thursday, October 9, 2014

exercism_io revisited

I recently got back into exercism.io. For whatever reason I only completed the first Ruby exercise and never returned, but now I have turned over  new leaf. I have decided that I need to write more code outside of work. Lately I have only been reading books and solving small problems on treehouse.

exercism is an awesome tool that is obtainable for any novice in programming in a multitude of languages.

I feel as if I am a decent Ruby programmer but could use some help in the "Ruby Way" of doing things and best practices. exercism_io will hopefully get me to the next level; the feedback I have already received from my first submission has already helped.

I have also made my first Swift submission which was ok, the actual code did not compile and I couldn't get the test suite to run in xcode. I have been bootstrapping my learning in Swift with the free Swift books offered by Apple on the iBooks app. I highly recommend picking that up.

If you are looking to join a group on exercism, join us on the Ruby Newbie team and if you need help setting up exercism, feel free to reach out.


Thursday, October 2, 2014

Ruby Science

Ruby Science is a book written by the popular Rails shop, Thougtbot. I had the opportunity to try out their upcase program a few months ago but cancelled it because it wasn't what I was looking for.

I however have recently acquired their Ruby Science book and absolutely love it. If you like myself, are newer to programming, Ruby, or just look for better ways to write your code, then I highly suggest this book.

I began reading this book last Friday and accidentally read the whole thing by Sunday, it was that good. I have usually taken the approach of reading books slowly and pondering on the concepts to really get them but this book was just too good. It might be hard to tell but I am pretty excited about this book.

I did not realize at first but the way this book is written is sort of a choose your own adventure style, where the book is broken up in 3 sections., Code Smells, Solutions, and Principles.

The Code Smell section is full of code that looks like what I would write, good code but bad practices, for example a "Long Method." Methods are meant to be short 3-7 lines and if they are larger they can probably be refactored. This chapter was so eye opening I went back to a pull request I created that Friday morning and made tons of changes and got some pretty awesome comments from my coworkers on my abstraction, little did they know it was because me reading this book.

The second section is on Solutions. You hear a lot of talks and know the buzzwords about writing clean code, but this book really breaks it down to the point where you just get it. There is definitely no fluff and extravagant examples but I really enjoyed this approach in the book. To get an idea of what I am talking about, the book is as straight as the front cover, right to the point of everything.

The final section is on Principles in programming. I learned what the Law of Demeter was because of this section, as well some other really big terms. I have heard of so many of the terms but never really knew their meanings. I actually knew of the Law of Demeter Concept but did not realize what it was called. It's the idea keeping your method calls to one and not chaining method onto to method on to method, i.e. `run.forest.run` .
















When I first started this programming journey, I watched a fair bit of conference talks, most that went over my head. I recently was re-watching CatchupConf, specifically Ben Orenstein's talk on Refactoring and found that so many of those concepts explained that I didn't understand, I now understand and even have been using these past 3 months working as a developer.

Here is a sample of the book: Ruby Science


Teaching Github to College Kids

I recently had the opportunity to teach a group of UCF Engineering/Computer Science students how to use git. There is an organization called Engineers Without Borders at the University of Central Florida in Orlando; The president of the organization reached out to a coworker of mine to teach them about Github. My coworker was unable to attend and threw it out there to the team and of course I had to accept.

I truly enjoy teaching others and love taking the opportunity when ever I can.

The meeting was on Monday of this week and I spent the weekend preparing a short slide show on the topic. My understanding that the students need to know how to use git and Github in order to collaborate on group code projects.

The group of about 40 kids were mixed with all different types of engineering backgrounds, some with experience in code and some without.

My approach was to share how git works initially and it's basic commands, Unfortunately the school was not equipped with a thunderbolt to VGA adapter, and I failed to put one of two I owned in my backpacked. So I presented from the limited Windows PC showing git via Nitrous.io, which was quick thinking on my part.

Overall the presentation went ok, despite the technical glitches with the internet. I was actually surprised that a handful (maybe 3-4) of students already knew git and had a github. one student really impressed me and already had a Rails project built (only if I got into to Rails in college, I'd be a baller right now).

Teaching git has actually taught me a few new git commands I have begun using, like `git reflog` which gives you the ability to see all commits on the project. I also learned despite deleting a branch or commits they all live there and are retrievable by their unique commit id.

Remember git saves changes, not files.