magic comes from work

I started Active Record tonight and I’m stoked. Mostly because a lot of the work has already been done and now I can just use the magic that is provided to me. I think I have always had the basic understanding that there are libraries that will be doing a lot of the things I have been learning for me. That is why when I get stuck on things but can still complete projects and labs I just push through. I definitely save bookmarks to go back to if need be but ultimately I want to see how granularly I really need to know some of these concepts before I spend hours learning them deeper. While I know having the deeper understanding is a good thing I also have a timeline I’m working with and can dive deeper into topics once I’ve graduated or have landed a job.

Database migrations are a nice thing to have.

I got stuck for a while tonight because my environment was throwing an error in relation to the JSON gem. Specifically, version 1.8.3 which was in the Gemfile.lock of a few of the labs I’ve worked on tonight. I learned with the help of a Learn Expert (someone who’s around to help out students) that the Gemfile.lock is pretty much a set of dependencies that were used when the files were written and are statically set to keep things consistent. So we deleted that file and ran bundle again and everything worked fine. Luckily I asked why we did what we did so I would know enough to repeat the process tonight. Every time I run into this problem I do raise an issue on GitHub so hopefully, it’ll be taken care of for those following behind me.

I feel like I’m behind on the target I set for myself and I have the Free Code Camp Nashville meetup to go to tomorrow. Plus a wedding shower on Sunday. I still plan to be done with Rack this weekend. That’s 22 lessons/labs. I also am considering adding an extra full day into next week by having my nanny come and watch my girls on Friday. So instead of 3 hours next Friday night, I can hit it hard all day and have a 10 hour day. We’ll see how I feel after Monday’s progress.

Something I did to save some time is now when I generate my static blog files they automatically are put into my proper local file location to be uploaded to the separate repo. That’s a complicated sentence to say, I keep my content in one folder and repo, and my public facing files in another folder and repo. I had been generating the public file then copying and pasting in my file manager. Now the files are generated directly into the proper folder saving me a few steps and speeding up my publishing time.

Time spent today: 2:43
Time spent total: 137:55
Lessons completed today: 5
Lessons completed total: 330

rocks working out

So I wanted to share the hacks that I’m using to upgrade my life some and increase my mental aptitude to crushing this curriculum. There is a certain amount of mental stamina that has to be maintained on a day to day basis to keep up this pace. So… here’s my brain upgrades/biohacks/etc… that keep my moving tip top while doing this bootcamp full time and taking care of kids full time. All with links to the best place to buy them.

First thing is my coffee. I start my day off with my take on, Bulletproof Coffee. I currently use Central American Single Origin Organic whole bean coffee from Aldi. The most important thing for me is my coffee being light to medium roast. Nothing dark. I also like whole bean because coffee really does taste way better if it’s fresh ground. I add to that 1 tbsp of Thrive Market Ghee and 1 tbsp of whatever I have around to up ketones. I prefer Brain Octane Oil because it definitely is nicer on the insides but also use Now Foods MCT Oil or just Coconut Oil if I have neither of the aforementioned. I blend this all up together. This gets me going and curbs hunger for hours. I also pop a couple BioScience Brain Boost and wash them down with my coffee.

I then hopefully do my Gymnastic Bodies Daily Limber routine to get the blood flowing some. I follow that up with some meditation utilizing Calm. I try (but usually fail) to write my daily journal entry utilizing this template I built in Evernote. I very rarely get all of these things done. However, I try to.

When I’m on long coding sessions I supplement in the middle of the day with Four Sigmatic Lion’s Mane which I’ve found can really get me going. I have to ensure I’m stimulated enough mentally or I start getting distracted trying to keep my brain working hard enough. I also diffuse essential oils in my workspace. Specifically Lemon, Rosemary, and Eucalyptus. All three of those are supposed to help with concentration and mental performance. I find the scents definitely keep me alert if not anything else. Something that I recently ran across is Nootrobox Sprint and I’m interested to try it out. I might just order the mini bottle for $15.

That should be it if I remember correctly. If I realize I missed something I’ll update this post.

UPDATE 3/31/17
I completely forgot about how I listen to whenever I’m doing work. It really zones me in more than anything I’ve ever listened to. I used to use Spotify playlists but now this is the ONLY thing I’ll listen to when I need to concentrate.

Almost 3 hours of review vidoes watched tonight. On thing that I think can be very useful to all. A double bang !! converts an object to it’s truthy value. For example:

[email protected]:~$ irb
2.4.0 :001 > 1
 => 1
2.4.0 :002 > !1
 => false
2.4.0 :003 > !!1
 => true

So the return value of 1 is 1 we know 1 has a boolean value of true. So !1 is false and thus !!1 is true. This can be useful for obvious reasons.

Time spent today: 2:41
Time spent total: 135:13
Lessons completed today: 3
Lessons completed total: 325

Tonight I had my CLI Gem Project review with one of the instructors. It was pretty cool. I talked through my project from start to almost finish (I realized after we finished we never went over the last method that takes user input to either start over or end). We added another class and refactored some code to make my gen more extensible and flexible in the future. While they’re not official tasks I set a couple new features I want to add to the gem.

  1. Allow users to pick the date that they want meetups for instead of only returning current day meetups.
  2. If a person sees a meetup they want more info on they can enter its number and open the page for that event in their default browser.

I think these are two useful and good additions. I’m not sure when I’ll find the time to get them done but I’ll get them done. Cernan who did my review also informed me that he has seen students get hired just from having a solid CLI Gem so I definitely want to make this portfolio project stronger than it currently is. I think adding those two features I will be able to call it v1.0.0 and release it into the wild.

I finished up ORM except for some review videos which I’ll watch tomorrow. I could have finished the first video but my wife took our eldest daughter to get ice cream and my infant decided she didn’t want to be happy unless she was being held. However, there are worse things than not being able to code because your daughter wants to be held. Eventually, she’ll be too big to fit in my arms so I’ll enjoy it now. Hopefully, I can put an extra hour in tomorrow and catch back up to where I want to be this week.

Time spent today: 2:10
Time spent total: 132:32
Lessons completed today: 4
Lessons completed total: 322

Tonight I was able to get much deeper into the ORM section. The curriculum returned to the lesson then lab format that is more familiar. Learn how to build a few methods and why you build them that way. Then immediately do it locally. Then the next lesson builds on the last. This is much easier to make progress through and I feel much better about databases now. Well, I feel much better about how they integrate and how Ruby wraps them. I’m on a lab entitled “Bringing It All Together” and it looks like there is a small section on Dynamic ORMs before I move into learning about ActiveRecord.

A spot where I got stuck for a bit was instantiating a new object using a Hash. This is something I had not done before and was not easily found via DuckDuckGo (yes my default search engine is not Google). So I ended up throwing some code I found into my file and it passed the test! Here it is:

def initialize(h)
  h.each {|k,v| public_send("#{k}=",v)}

I still had to make sure I had my attr_accessor‘s in place to pass my tests but that’s a pretty nifty piece of code I’ll be sure to save for later.

The same music library examples are being used and I’m having flashbacks to my Music Library CLI project that I completed with Mike. I can only imagine building that again utilizing a database. Hopefully, by the end of this DB section, I won’t feel as intimidated by such a task.

On a non-coding note. My youngest daughter hasn’t been getting up in the middle of the night to eat so now I’m being tasked with her first meal of the day because mommy is almost out the door at that time for work and doesn’t have time. This means I’m getting up at 6am pretty regularly right now. It’ll be nice if she starts sleeping until 7 or 8. If she keeps this up though I’m going to go back to a split coding day with some time in the morning and night.

Time spent today: 2:41
Time spent total: 130:22
Lessons completed today: 8
Lessons completed total: 318

Polished off the SQL tonight and I have to say it was more in depth than I thought it would be. It’s one of those things that is hard to visualize being new to it. When the tables are laid out in a grid it all makes sense but just trying to do it all in your head is confusing, even for me. I’m sure if I was doing it every day it would be much more intuitive but right now I’m still a little fuzzy on keeping track of the data I’m looking for through multiple JOINS.

I started on ORM (Object Relational Mapping) tonight but only got through the first lesson and lab before calling it. I’m seeing how it all connects through to store data persistently. The main thing being this:

An ORM is really just a concept. It is a design pattern, a conventional way for us to organize our programs when we want those programs to connect to a database. The convention is this:

When “mapping” our program to a database, we equate classes with database tables and instances of those classes with table rows.

This overview really makes it simple to think about the objects I’ve been working with and how they’ll be stored and retrieved.

I’ve realized my 7 lessons/labs per day is pretty ambitious. Especially on these days when I work for ~3 hours. I think I can make up the rest on my LONG weekend coding sessions if I actually get 10+ hours in on Saturday and Sunday. We’ll see.

Time spent today: 3:20
Time spent total: 127:41
Lessons completed today: 3
Lessons completed total: 310

Today started with multiple review videos on the CLI Gem Project. I also was able to schedule my project review for Wednesday night. I’m looking forward to some one-on-one time with an instructor talking through my code. The project states:

1. Explain your code from execution point to exit point. We’re making sure you wrote it and understand how it works, nothing else. 10-20 minutes
2. Refactor code. 10-20 minutes

If necessary, after the assessment, be prepared to:
1. Extend the application with a new feature, more data, a different domain etc. 20-30 minutes
2. Submit an improved version.

However, until then I’m pushing on.

Today I got through most of the SQL (Structured Query Language) section of the curriculum, 89% to be exact and I’m committed to finishing it up tomorrow. In this section I’m learning:
– How to create SQLite3 databases.
– How to create, update, select, and delete data from database tables.
– How to relate data within a given database.
– How to write SQL code in both my command line and my text editor and execute the code against a database.
– How to write Ruby programs that talk to and save data to my databases.

I have to say it’s more interesting that I thought it would be. In addition, I can see perfectly how databases fit into the whole web app ecosystem. It’s also fairly easy to pick up the SQL DSL (domain specific language) because it’s pretty much just procedural coding. I also have done a couple intro SQL Server courses in the Microsoft Virtual Academy so the vocabulary wasn’t new to me and I understand the 30,000 ft view of databases and relational databases.

I feel good about progress again after today. I had felt stalled (I know I was making progress though just couldn’t see it as much in the “numbers”) for a bit. Coming after SQL is Object Relational Mapping (ORM) and ActiveRecord, then Rack, then Sinatra where I’ll build my next portfolio project. After that comes Rails and when I’m done with Rails the job hunt can commence, although, I’ll still have more learning to do to graduate. After Rails is a bunch of Javascript, Rails and Javacript, React and finally Redux. It’s a lot but I know will move by at a good pace. My ambitious goal is to be done with or working on the Sinatra projects by 4/9/17. Two weeks to complete 40 lessons and 55 labs… that’s 7 per day. I think I like that. Instead of setting an amount of time to get things done completing a set amount of the curriculum. As long as I pull out projects which take much more time I think this could be doable in the long run. I wonder what my pace has been so far… 10.96/day is the pace I’m sitting at. Hmmm… maybe I’ll stick with the time format as I seem to be getting more done that way. Either way, I’m going to benchmark and see if I’m at 48 more lessons complete by next week and on pace. This is good.

Time spent today: 6:00
Time spent total: 124:21
Lessons completed today: 17
Lessons completed total: 307