I have basically gone through the majority of Eloquent Javascript, working through problems here and there, and just about done with it. The book has definitely taken more time to get through than expected, mainly because it is new territory for me. I have found that Javascript is language I have to get hands on writing with, actually Ruby was the same way. I can't just read Eloquent Javascript and pick up the concepts.
I have found great success working through Javascript Koans. The basic form of Koans are simple programming test which you make pass by literally inputting the answer given. I did spend time filling in the answers without looking them up but when I got stuck all I need to do is run the test and read the assertion for help. My explanation of Koans does not give it justice, which is why I highly recommend checking it out for yourself.
Prior to moving to Orlando and taking my job at IZEA, I work through the entirety of Ruby Koans, this helped me learn the syntax of Test::Unit. Previously I only had experience with Rspec and the majority of the testing at my new job was Rspec.
Another thing the Koans taught me was how to write more test. The structure of Javascript and Ruby Koans does not require you to write test, but from reading the already made test it help me understand how to write proper and more extensive test.
Like I said in a previous post, it's hard to be inspired when you never look at the way others do things. If you write Javascript or Ruby and are not testing currently or want to expand your knowledge into testing, download the repos for Ruby and Javascript Koans today.
*Please note there are other types of Koans out there but I feel these are the best introductions into them.
This is my personal blog and journey in learning a new skill, Web Developing. In only 7 months I made a career change into this field by dedicating 25(avg) hours a week in studying Ruby. #All words are my own, except the ones I copy and pasted.
Thursday, November 20, 2014
Wednesday, November 12, 2014
My Baby Steps into VIM
I have spent a lot of time attempting to complete the challenging Vim-Adventures, but have found solving the integrated puzzles more challenging actually learning VIM. I am actually still stuck on level 9, I found I needed to learn VIM faster and actually completed vimtutor twice.
Vim-Adventures is definitely one of the best ways to learn muscle memory, as you tend to learn how to move around without even thinking about it. The vimtutor tutorial is definitely one of the best tutorials and covers a lot in a short amount a time. I imagine you can complete the entire tutorial in less than an hour on your first run through.
The entirety of my VIM learning was completed while running the test suite at work, which unfortunately takes about 30mins each time (something we are working on in making better). I decided last week that after spending 2 months learning VIM in small spurts, it was time to actually start using it.
I got a very brief walkthrough after my last TDD practice session. I got to see tmate.io (actually tmux and not vim, but still a cool tool) working in the wild and even install the JANUS VIM package. Last week I attempted to work on a feature using VIM but quickly found out despite my extensive research and practice, the previous tutorials do not have sections on working through the file system.
I moved on to learning through the free Vimcast and Vim Novice Tutorials which has helped in learning the VIM workflow, like splitting windows and entering and exiting the file system.
I am not yet ready to use VIM at work but I have been working through the Javascript Koans. I am finding that koans is a nice and safe way to learn how much I would rather be using VIM at work. My goal is to switch over when I complete the the entirety of the Koans and become a little more proficient.
If you are at any level interested in try out VIM, either type vimtutor in your terminal or checkout Vim-Adventures. Warning, once you get the initial muscle memory down, you might get addicted.
Vim-Adventures is definitely one of the best ways to learn muscle memory, as you tend to learn how to move around without even thinking about it. The vimtutor tutorial is definitely one of the best tutorials and covers a lot in a short amount a time. I imagine you can complete the entire tutorial in less than an hour on your first run through.
The entirety of my VIM learning was completed while running the test suite at work, which unfortunately takes about 30mins each time (something we are working on in making better). I decided last week that after spending 2 months learning VIM in small spurts, it was time to actually start using it.
I got a very brief walkthrough after my last TDD practice session. I got to see tmate.io (actually tmux and not vim, but still a cool tool) working in the wild and even install the JANUS VIM package. Last week I attempted to work on a feature using VIM but quickly found out despite my extensive research and practice, the previous tutorials do not have sections on working through the file system.
I moved on to learning through the free Vimcast and Vim Novice Tutorials which has helped in learning the VIM workflow, like splitting windows and entering and exiting the file system.
I am not yet ready to use VIM at work but I have been working through the Javascript Koans. I am finding that koans is a nice and safe way to learn how much I would rather be using VIM at work. My goal is to switch over when I complete the the entirety of the Koans and become a little more proficient.
If you are at any level interested in try out VIM, either type vimtutor in your terminal or checkout Vim-Adventures. Warning, once you get the initial muscle memory down, you might get addicted.
Wednesday, November 5, 2014
Invalidating text as html with Nokogiri
I am finding a lot of my issues with writing code at work is due to the specific use case of our industry.
I was given the task to add an input box to a form that will allow HTML snippets; these snippets can be a variety of types but of course exclude script tags. I wrote a line of code that validates HTML but it failed QA testing since plain text was allowed to be added to the form.
This check_html method validates the HTML provided, but it was still allowing plain text, which is a functionality I had to circumvent. I finally came across a hacky solution which was to parse the content using an XML call. After 90 minutes of deliberation I came to this solution:
*note: I was checking for image tags because the XML call specifically disregards the "<img>" tags and requires "<image>", but this worked because it disallowed plain text to be input. I was later informed by my peer that not all XML was valid html and there would not stand the chance of time, I did say this was a hacky solution.
Not proud of this, I submitted my code for peer review and was quickly informed that my attempt was noted but plain text is valid html... Not taking any formal "HTML" course in college I had not known of this fact; All that work to only eventually find out that I was trying to invalidate something that was technically valid.
I was then provided this solution thanks to code review:
I hope sharing this will help anyone else in the trying to validate html in put forms, this have proven to be a great learning experience.
I was given the task to add an input box to a form that will allow HTML snippets; these snippets can be a variety of types but of course exclude script tags. I wrote a line of code that validates HTML but it failed QA testing since plain text was allowed to be added to the form.
This check_html method validates the HTML provided, but it was still allowing plain text, which is a functionality I had to circumvent. I finally came across a hacky solution which was to parse the content using an XML call. After 90 minutes of deliberation I came to this solution:
*note: I was checking for image tags because the XML call specifically disregards the "<img>" tags and requires "<image>", but this worked because it disallowed plain text to be input. I was later informed by my peer that not all XML was valid html and there would not stand the chance of time, I did say this was a hacky solution.
Not proud of this, I submitted my code for peer review and was quickly informed that my attempt was noted but plain text is valid html... Not taking any formal "HTML" course in college I had not known of this fact; All that work to only eventually find out that I was trying to invalidate something that was technically valid.
I was then provided this solution thanks to code review:
Nokogiri parse the HTML and separates each element tag into children and nodes. This code checks to see if thre are any children that have nodes with plain text and finally invalidates those. Like the intro to Star Trek: Enterprise, "It's been a long road".
Monday, November 3, 2014
My tour with Javascript
I have spent this weekend learning some more Javascript using the book Eloquent Javascript. I have not put as much dedication in learning Javascript until very recently. I have worked through part III of the Javascript Roadtrip on Code School which has been challenging, but not hard I previously thought.
I am finding having a basic understanding in Programming and Ruby makes learning more advanced Javascript a lot easier. I am about to begin chapter 8 and very much enjoying this book and the ability to solve exercises in the browser. I am however, having a lot of trouble just figuring my way around solving problems outside of book. I spent 3 hours on the exercism problem that I solved easily in Ruby.
Learning the Javascript way of doings things has proven to be the challenge. For example I am currently trying to figure out enumeration in Javascript, which is easy in Ruby because I know the name of the standard library methods. I just need to find better sources for looking up Javascript functions, `forEach()`.
Friday was another "hackday" where I spent the entire time working on an app for work called "Beer Club." I am part of a club where we all chip in to buy a new keg for the office and seem to be getting hung up on the voting of a new keg. The app would allow us to add multiple beers to a list to eaily vote on.
I unfortunately started the app in Ember and spent most of the day learning how to play nice with the framework. It was a similar experience when I tried to first learn Rails. The day eventually ran out I restarted the app in just Rails with a basic bootstrap template. I am looking forward to finishing this app for obvious reasons and plan to shoe horn Ember in it once the Rails portion is complete.
My plan is is to now switch my focus away from iOS and put all my learning efforts into Javascript, since it is a tool I use at work and will benefit from a lot sooner.
2014 was the year of Ruby for me, I am thinking 2015 will be full of JS.
I am finding having a basic understanding in Programming and Ruby makes learning more advanced Javascript a lot easier. I am about to begin chapter 8 and very much enjoying this book and the ability to solve exercises in the browser. I am however, having a lot of trouble just figuring my way around solving problems outside of book. I spent 3 hours on the exercism problem that I solved easily in Ruby.
Learning the Javascript way of doings things has proven to be the challenge. For example I am currently trying to figure out enumeration in Javascript, which is easy in Ruby because I know the name of the standard library methods. I just need to find better sources for looking up Javascript functions, `forEach()`.
Friday was another "hackday" where I spent the entire time working on an app for work called "Beer Club." I am part of a club where we all chip in to buy a new keg for the office and seem to be getting hung up on the voting of a new keg. The app would allow us to add multiple beers to a list to eaily vote on.
I unfortunately started the app in Ember and spent most of the day learning how to play nice with the framework. It was a similar experience when I tried to first learn Rails. The day eventually ran out I restarted the app in just Rails with a basic bootstrap template. I am looking forward to finishing this app for obvious reasons and plan to shoe horn Ember in it once the Rails portion is complete.
My plan is is to now switch my focus away from iOS and put all my learning efforts into Javascript, since it is a tool I use at work and will benefit from a lot sooner.
2014 was the year of Ruby for me, I am thinking 2015 will be full of JS.
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?
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
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.
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.
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.
Subscribe to:
Posts (Atom)



