Jocko Clock – The Pomodoro Clock with Jocko Willink

Allow me to introduce Jocko Clock.

Jocko Willink Pomodoro Clock

Free Code Camp has various projects in which aspiring software engineers write programs as they complete the coursework. One of the projects requires the student to build a Pomodoro Clock.

The idea behind a Pomodoro Clock is that you set a 25-minute timer as you begin a task. You promise yourself ahead of time that you will work on that task until that time has elapsed. With luck, you will be inspired to keep working after that 25 minutes is complete. At its core, the Pomodoro Technique is a procrastination elimination tool.

I know no public personality that inspires procrastination destruction more than Jocko Willink. His podcast always inspires me to work harder and wake up earlier. That’s why I made the Jocko Clock.

Jocko Clock

So the above project combines the principles of the Pomodoro technique with audio clips from Jocko Podcast. I sourced the recordings from YouTube.

Clip 1 – Get out of Bed | Clip 2 – Not Feeling It?

Whenever you load Jocko Clock, you’re greeted with Jocko’s voice,

“Get up and get after it.”

After you complete your 25 minutes, you get another message from Jocko.

“…you stayed on the warpath.”

Developing Jocko Clock

While building the clock, I went down a lot of dead-end roads. I integrated JS libraries that were complex, CSS libraries that broke everything and a host of other bad ideas.

After a lot of confusion, I found that simple jQuery and JavaScript were the best for executing these simple tasks.

To get the clips, I recorded the YouTube audio with Screenflow. Screenflow has a leveling tool which I used to homogenize the levels. Then I used Audacity to downsize the audio files from 3-megabyte .aiff to a 100-kilobyte .mp3 (64kbps is fine).

Jocko Clock Improvements

If you think you could help with any of these improvements, feel free to create a pull request. This clock is open sourced and available on GitHub here.

Center Align – I’m having a really hard time vertically aligning the clock so that the font grows and shrinks with the window size. I was able to weasel my way out by adjusting the image and the watch layout, but I wish I could make it responsive to the window size.

Font –  The font should match his actual watch, but I couldn’t find a Google font that fit the bill properly. Below is an image of what it should ideally look like:

jocko clock

A Bigger Library of Audio Clips – The tool would be more fun to use if the audio clips were randomly selected from a large library. That way, each time the user started a working session, they would have a gamified inspiration to get after it.

Quick Check – Ian’s Wikipedia Search Tool

In order to achieve the front end developers certificate from FreeCodeCamp.com, one must build a tool to search Wikipedia. Here is mine:

Ian’s Wikipedia Search Tool – Quick Check

wikipedia search tool
Ian’s Wikipedia search tool

This challenge was very challenging for me in the best of ways. It utilized the algorithm practice that I love with complex new libraries. You could say that I’m learning to love jQuery and AJAX.

When adding HTML and CSS into that JavaScript mess, the project was a real challenge for a junior programmer like me.

Process and Design Notes

I focused on simplicity when designing the front end.

FreeCodeCamp.com stipulated in the challenge that we were to design a button which would initiate the search. I broke that rule. My API calls were triggered by a ‘button up’ event, rather than a button. The idea is that the user gets immediate feedback and thus would find the tool more useful.

If you’re interested in the development process, you can see the different version updates on my GitHub project.

Though I built the button into the project initially as per spec, I removed it towards the end. If a search is triggered by the last button typed, there is no need for a search button at all.

The Best Free Code Tutorials

What follows is a list of the best free code tutorials in my opinion. I’m proposing only the programming tutorials that I found taught me the fastest and the ones I enjoyed participating in.

best free code tutorials

There are many slow, boring video series I’ve gone through in the hopes of learning to program, but what follows are the programs that I found to teach me the subject quickly and were fun to complete.

Overall Best Free Code Courses

  1. Free Code Camp – http://freecodecamp.com/ – Free Code Camp is an open source, game-like software course that teaches everything from HTML to computer science ideas like
  2. CodeFights – https://codefights.com/ – I would suggest this is more of an intermediate way of learning. Once you get good with algorithms, this might be a great way to get on the radar of interesting software engineering companies.
  3. Codecademy – http://codecademy.com/ – These exercises are the best for getting an initial introduction to any technologies covered on their platform. Also, if I want to revamp some skills quickly before approaching a new project, bashing through Codecademy is a great way for me to freshen up on skills.

Best Specific Code Technologies

JavaScript

JavaScript is a very important language for the internet. If you want to have a good idea of what JavaScript looks like when navigating the web, go to Chrome>Preferences>Content Settings and shift the “Allowed” tab off. Once you’ve turned JavaScript off, go to your favorite websites and see the difference.

NPM

What is NPM? Node Package Manager is a protocol for using JavaScript to build applications. At this point, all I know is that it empowers the programmer to use the terminal to build web applications in JavaScript.

Regular Expressions (RegEx)

What is a regular expression? A RegularExpression is a line of text formatted to get you a result. For example, if you wanted to find all the dollar amounts from a tremendous text document, you can use a regular expression to pull out all the numerical numbers after a “$” symbol.

jQuery

What is jQuery? jQuery is a library of JavaScript which makes using JavaScript easier on web pages. For example, you write a HTML search box into a webpage and you want to process the input from the user to do something. You could use jQuery to take the user information and put it into a JavaScript algorithm.

Learn.jQuery.com – http://try.jquery.com/

SQL

What is SQL? SQL is an acronym for Structured Query Language. Pronounce it, sea quell, rather than S.Q.L.  This is a database language for retrieving data and creating data. Note: a basic understanding of RegularExpressions will help before starting the SQL tutorials.

Expample Format
SELECT <something>
FROM <dataset>
WHERE <attributes you care about>

SQL Bolt – https://sqlbolt.com/

Best Free Code Tutorials – Parting Words

I’m no expert at this. In 2016 I spent a year deep diving into software engineering, but I ran into a wall and decided to build a school bus home. That home took me about 9 months to build so I fell off the programming horse during the months from March to November of 2017.

For me, there is still a haze obscuring my path to understanding software engineering. Though the haze has lifted consistently during my studies, I still feel considerably lost in it. The above suggestions were from the tutorials that cleared the haze out the fastest. I’m sure it’s not a complete list, but it is the list of technologies that helped me the most.

Please add any suggestions in the comments below. I would really appreciate learning faster ways to blow the haze away.

Elchanan Mossel’s Probability Problem in JavaScript

An interesting problem popped into my twitter feed this morning:

Here’s how I wrote the problem in JavaScript:

function rollDie() {
  return Math.floor(Math.random() * (7 - 1) + 1);
}

function allEven(arr) {
  for (var i = 0; i < arr.length; i += 1) {
    if (arr[i] % 2 !== 0) {
      return false;
    }
  }

  return true;
}

function rollsToSix() {
  var rollResults = [];
  var sixRolled = false;

  while (sixRolled === false) {
    var roll = rollDie();

    if (roll === 6) {
      rollResults.push(6);
      sixRolled = true;
    } else {
      rollResults.push(roll);
    }
  }

  console.log(rollResults);
  return rollResults;
}

function howManyPositiveResults(attempts) {
  var positiveResults = 0;

  for (var i = 0; i < attempts; i += 1) {
    var resultOfRoll = allEven(rollsToSix());

    if (resultOfRoll === true) {
      positiveResults += 1;
    }
  }

  return positiveResults;
}

console.log(howManyPositiveResults(100));

The above program runs the results 100 times and returns the number of positive results. It also logs all the rolls even if the consecutive rolls included odd numbers.

It was fun to watch Mike Lawler do this problem with his children. I learned another approach to the problem from him. You can watch it here:

Exploring Elchanan Mossel’s fantastic probability problem with kids

t6r – Twitter Spam Hack Reactor Founders With Their Own Random Quotes

Getting stuck is the hardest thing about learning computer programming.

While working my way through Free Code Camp, I was stuck on the Random Quote Generator project. It’s part of their intermediate front end development certification.

Luckily, I had been applying to Hack Reactor and was conditionally accepted as soon as I completed the Pre-course Accept (PCA) program. While working through the PCA program with a big group of Hack Reactor people, we had the same project as Free Code Camp. We were to build a random quote generator.

So I used their random JavaScript algorithm to display random quotes at the click of a button. Very basic jQuery.

Heres the thing… the quotes are really funny. How could this be more useful?

It’s pretty clear that the random quotes were crafted by people who started the schools. The folks who came up with the first Hack Reactor curriculum.

So I wrote a short click to tweet algorithm and generated the quotes so they were easily shared on twitter. Now, anyone who wants to spam the founders of hack reactor with random quotes can do it with ease.

This is just for fun of course. A little mischievous fun on the internets. Despite the fact that I didn’t end up attending Hack Reactor, my experience learning with them for the PCA portion of the bootcamp was excellent.

Anyways, here’s how it turned out:

http://t6r.ianrobinson.net/

Setting Up Your Custom Domain Email Accounts

So I spent much of today trying to make the best screencasts I could.

I do have a question for anyone reading this blog.

Notice that in the first movie, I invest a lot of time into zooming in on the specific sections of importance.

In the second video, I ran of time and just completed it without the zooming in effects:

Which do you think is more useful for someone seeking this information? If you think the zoom is valuable, on a scale of 1-10 how important do you think it is?

Dismissed from App Academy

sf_bay_bridge
Sometimes things are black and white in San Francisco

I was dismissed from App Academy for failing all my exams on the 28th of November 2016. Ugh…

I am writing to inform you that due to your performance on the retake assessment it is our obligation to dismiss you from the course.
– App Academy

I tried as hard as I could to get good and pass the tests, but it wasn’t good enough.

After two retakes on the first two tests, I could never get the correct results on more than 85% of the specifications. Without exception, I found myself at the bottom of the class.

It really hurts, but I feel like it’s actually for the best. After the fourth examination, I wrote an email to my pod leader and let her know that I was leaving the building to save them the headache of asking me to leave. The last two weeks of my life had been spent in that classroom from 8:30 A.M. to 6:30 P.M.

For the next four hours I walked around San Francisco as my mood fluctuated between devastated defeat to excitement for a new chapter. It kept going back and forth. Now a few days later, I’m comfortable with it all. Here’s what I learned.

sf_tower

Things I Learned:

A LOT about Programming

App Academy (and Hack Reactor*) are excellent schools. They boil down the learning process and teach a lot of very challenging concepts quickly. Even though I’m happy I’m no longer attending a bootcamp, I wouldn’t tell anyone not to do them. They are great. I just wasn’t the right fit.

Office Life is Not for Me

My body started deteriorating in the first two weeks. Since being dismissed, five days have passed and I’ve gone to CrossFit three times. I’m back to feeling strong and healthy. The first day back, I was in very sad condition.

Since being dismissed I’ve spent the day outside, I’ve gone to movies in the middle of the day and I’ve taken sales calls whenever I wanted to. It was great to have this freedom locked up for a pair of weeks so I could reconnect with the value of freedom.

sf_sky_scraping_buildings3

My Current Position is Great

So my friends and I run a podcast production company where we are very free to do work we care about while traveling the world and never stepping foot in an office.

Spending two weeks in an office learning very dense material helped me to realize that I loved the position we have built for ourselves at Freedom Podcasting. Before the class, I had a magical view of working in a tall sky-scraping building with people that are highly sought after. After two weeks in App Academy, I’m happy to not be in an office anymore.

Programming Skills are Hard to Learn

On my last day at a/A we learned SQL in a day. It’s impressive that a/A has such an intense learning curve, but I feel like I’m happy to slow down a little bit and learn these skills at a deeper level.

Gender Neutral Bathrooms?

I’m not a big fan of gender neutral bathrooms or announcing our gender pronouns as a new way of communication.

I’m skeptical about organizations where social/political initiatives are institutionally forcing people to speak in a specific way. There was a great podcast with Jordan Peterson where he discusses the dangers of this movement.

sf_sky_scraping_buildings2

That’s it

I’m really sad I failed out. But I’m going to spend my time going to programming conferences, learning different technologies, lifting weights and growing Freedom Podcasting.

App Academy is an excellent program. It was just too intense for me at this point in my life.

Thank you for the run a/A -> Keep up the great work.

sf_sky_scraping_buildings

Learning Recursion in Ruby

“In order to understand recursion, you must first understand recursion.” – Source Unknown

SPOILER ALERT: If you’re an App Academy student, the answers are listed in this blog post so don’t read any further if you want to develop answers on your own.

How it Clicked For Me

visualizing factorials
Subsets Factorial Example

The key to understanding recursion is to get the base case.

To find the base case, define the easiest result.

Then think about the second easiest result.

As soon as you can get the first, second and third value, you have the solution for infinity.

It’s important to focus on the simplest case because when learning recursion, your mind can wander in the possibilities.

In the subsets example one can find a lot of strange patters when looking at all the subsets. Things like:

  • Could we work on this based on array length?
  • Is there a pattern in the order?
  • Perhaps we could shuffle the arrays and ask if they are in the range?

These sorts of thoughts can go for infinity. I think this is what recursion is seen as such a challenging thing. There is a lot of room for thinkers to develop ideas that get more and more complex as the program gets longer.

In the end, recursion will win.

Let’s start with the easiest implementation to understand, factorial.

Continue reading “Learning Recursion in Ruby”