Ruby On The Beach: Week 3

January 25th, 2015 - Ubud, Bali

Another week of Ruby On The Beach has flown by! This week was particularly exciting, as we dove into the concept of Rails, a framework that enables the creation of powerful applications written in Ruby. Packages like Rails are an amazing reminder that software developers today are standing on the shoulders of giants, having been equipped with wonderful automation and behind the scenes processing power. It was incredibly empowering to see how quickly and easily we could build apps that just a decade ago would have taken exponentially longer.

It was another challenging week of absorbing programming concepts and beginning to put some of our knowledge to work by building real apps, but all of our work definitely began to pay off when we were able to interact with our code in the browser for the first time!

Screen Shot 2015-01-25 at 3.58.28 PM

One of the coolest aspects about reaching this milestone in the course is we were now able to tackle larger projects within small groups. This environment led to a lot of knowledge sharing, and I enjoyed picking up coding techniques and product management strategies from my peers within the cohort. Programming is hardly ever an individual undertaking, so it was a great experience to understand how folks with different backgrounds, skills, and mindsets approach solving the same problems.

Fabian, Luca, and myself designing a database schema (with instructor Brett observing)

The undertaking of a technology bootcamp entails a large portion of my week is spent in front of a screen, so having the accountability of RescueTime running in the background on my computer definitely helped keep me on track during those moments when focus started to fade. Although I bested my productivity score from the previous week, there's definitely still room for improvement. Screen Shot 2015-01-25 at 10.31.42 AM

As for my daily habit regimen, I started off strong this week before failing to check-in to all my habits on Friday and Saturday, as I definitely hit a wall and took some time to re-group before the beginning of another long week of learning. Screen Shot 2015-01-25 at 3.54.09 PM

The workout category is undoubtedly boosted by our yoga sessions three times a week, which I'm incredibly grateful to have incorporated into the curriculum. It's a testament to Ruby On The Beach's no burnout philosophy that we are encouraged to start our days establishing the mind-body connection and enjoying a much needed anxiety release. Screen Shot 2015-01-25 at 3.49.57 PM

Scaffolding in Rails

Our curriculum covered a plethora of rails concepts this week, including many I don't yet understand well enough to explain in a blog post. But there's one aspect that easily highlights the incredible powers of this framework: scaffolding. Pared down to it's most basic form, scaffolding enables the creation of a simple interactive website in just a couple of lines of code. Let's dive into this topic by building a semi-functional twitter clone.

Once the Ruby On Rails development environment is set up on your machine (which is no simple undertaking), to make a new application all you have to do is open the terminal and type:

rails new Twitter

Instantly, Rails goes berserk and configures a pre-ordained structure, then implements "gems" which enable the access of helpful third-party code blocks. Look at all those "automagically" generated folders and files!

Screen Shot 2015-01-25 at 4.34.57 PM

But at this point, our application doesn't actually do anything. We can quickly rectify that by running a devilishly simple command:

rails generate scaffold tweet username:string tweet:string

Let's break this down into bite-sized pieces:

  • Rails flags the terminal that what follows is a command in rails
  • Generate means we're about to create something!
  • Scaffold is what we're creating. Scaffolding is an easy way to build and interact with a simple application in the browser. It supports the creation, reading, updating, and deletion of objects - in this case, "tweets."
  • Author:string is an argument that means each instance of tweet should have a username that is a combination of numbers and letters.
  • Tweet:string means each instance of tweet should have some content as well.

Rails quickly interprets this and builds a whole set of files which serves as our basic scaffolding. If we now set up our database using rake db:migrate and fire up a local server by typing  rails server , then navigate to localhost:3000/tweets on a web browser, we can see the following:

Screen Shot 2015-01-25 at 4.40.04 PM

Incredibly, scaffolding creates bare bones HTML forms for all of the different pages you can now access. Without writing one more additional line of code, we can click on "New Tweet" to build an entire database of tweets. We even have the power to view, edit, and delete them.

Screen Shot 2015-01-25 at 4.55.53 PM

Now this might not seem miraculous to you, but the amount of work that Rails is doing on the back-end to enable this is relatively mind-boggling. Additionally, this is just one example of the power this framework enables developers with. I'm excited to see what next week's deeper dive into Rails has in store.

Ruby On The Beach: Week 2

January 18th, 2015 - Ubud, Bali

Just two weeks in to the Ruby On The Beach bootcamp experience, it's incredible to look back at the software concepts I was struggling with ten days ago and laugh at my own naiveté. Although my goal of becoming a bona fide programmer is undoubtedly still far away, it feels great to make progress every day and I've undoubtedly traversed a massive amount of material already.

In an effort to share insights into this experimental learning process, I've decided to share the outcomes from two ways in which I'm quantifying my progress and holding myself accountable throughout the course. The first, RescueTime, is an application that automatically tracks and categorizes how you're spending the time on your computer, providing insights into productivity and the biggest drains on your time. My first Weekly Dashboard shows a pretty focused week overall, with plenty of down time for reading Grantland, catching up on The Challenge, and even streaming NFL playoff games:

Screen Shot 2015-01-18 at 10.10.56 AM


The second, Coach.me, is the new name of Lift.do, an app I've written about before. Coach.me now offers chat-based coaching for $14.99/week, but the feature I love is completely free: daily habit check-ins. After experimenting with tracking a variety of different habits over the course of the last year, I've settled on six that are truly fundamental to my personal development and well-being. Most are self-explanatory, but #500WED just means writing 500 Words Every Day about anything that's on your mind. My first week of tracking got off to a solid start:


Screen Shot 2015-01-18 at 10.06.22 AMWondering why flossing made the cut? Want to learn more about developing positive changes in your lifestyle and be "scared straight" into developing a flossing habit? Check out this awesome illustrated Medium post.

During the first week, I was extremely motivated and actually really enjoyed diving into the fundamental aspects of programming. The concepts we approached in the second week of the curriculum were more challenging, and I spent significantly more time planted in front of my computer this week (13.6 more hours, according to RescueTime). Although there were stretches where I felt like I was repeatedly banging my head against a brick wall, in retrospect I definitely took huge strides in my understanding of Ruby.

Screen Shot 2015-01-18 at 10.11.15 AM

Although by sheer volume this was the most productive week I've ever had on RescueTime, those late nights of coding took a tool on my energy level and willpower, and I didn't prioritize well enough to have a great week of daily habits.

Screen Shot 2015-01-18 at 10.09.58 AMO Christmas Tree!

One of the most challenging projects we encountered in the curriculum this week was on the surface, incredibly simple: write a program that draws a Christmas Tree that looks like this:

Screen Shot 2015-01-18 at 11.44.18 AM

Appearances can be deceiving. Constructing this program left me utterly stumped for hours at a time, but I was eventually able to grasp the concepts associated with it and will now try to distill the code into terms anyone can understand.

First, notice that the entire program consists of merely printing spaces and asterisks (let's call them stars). In the first row, there's 1 star, followed by 3, then 5, and so on. If we were to represent this sequence as an equation, it could be (row number[starting at 0] = row number * 2 + 1). We can create a chunk of code to represent that:

def calculate_stars row
  row * 2 + 1

Ok, WTF is going on here?! First, we're defining a "method" called calculate_stars. Every time we type calculate_stars in different parts of the program, it will run this block of code. Calculate_stars also has an "argument", called row. Now when you run "calculate_stars 7", the method will take 7, multiply it by 2, then add 1. In row 7, calculate_stars knows to create 15 stars!

Second, let's calculate the number of spaces in each row much the same way.

def calculate_spaces width, stars
  width - stars

When we run the program at the end, we'll be providing it with two inputs: the number of rows and the width. Think about each individual line: if you know the number of stars and the total width, then you can figure out the number of spaces. Just do width - spaces! That's what is going on here.

Third, let's create another chunk of code that takes these calculations from above and translates it into actual printed stars and spaces. In order to do this, we'll need to run a loop that looks like this. Comments start with #HASHTAGS :)

# start with a blank line 
line = ""
# Below, stars is a variable. 
# It says, if there are 15 stars, run through this 15 times
stars.times do 
# Every time we do this, add a star to that blank line
  line = line + "*"
# Print that line out! 
 puts line

This is a good start, but we need to add in our spaces first. The final result is a method named print line that runs through two variables, the number of spaces and the number of stars. Good thing we calculated those using the first two methods!

def print_line spaces, stars
  line = ""
  spaces.times do
    line = line + " "
  stars.times do
    line = line + "*"
  puts line

Finally, we have to put it all together! This time we'll write a master method that uses the three sections we've already built.

# Let's draw_trees with 2 variables: rows and width. 
# This enables the creation of custom size trees. 
def draw_tree rows, width
# Let's run the code below for however many rows there are. 
# |row| will go up by 1 each time through the loop.
  rows.times do |row|
# Remember calculate_stars? Let's use it right now! 
    stars = calculate_stars row
# width - stars is equal to the number of spaces. 
    spaces = calculate_spaces width, stars
    print_line spaces, stars
# This handy line adds a star to both the left and right side. 
    width = width + 1
# End the loop 
# End the method

Now let's check out what happens when we run the program in our terminal with a width of 15 and 10 rows.

Screen Shot 2015-01-18 at 11.43.54 AM Success!! The best part is this program is flexible enough to create any size tree. The final output looks something like this. Can you figure out what each line means?

Screen Shot 2015-01-18 at 11.52.07 AM

Although we eventually figured out how to draw a base, invert the tree, and re-factor our code to include other fancy concepts like arrays and hashes, I think I should leave it at that for now. If you have any questions or certain parts didn't make sense, I would love to hear about it in the comments below!

If you're interested in other perspectives on the "bootcamp in Bali" experience, be sure to check out the blogs of two of my fellow students at http://www.chic-ceo.com/blog and http://rubybali.tumblr.com/.

Ruby On The Beach: Week 1

January 11th: Ubud, Bali
"All life is an experiment. The more experiments you make, the better."

Ralph Waldo Emerson

For the next nine weeks, this blog will adopt a decidedly different flavor compared to my previous travel writing. During this time I'll be a student at Ruby On The Beach bootcamp, learning software development while living in Ubud, the cultural and artistic capital of Bali, Indonesia. This is ultimately an intellectual experiment in pushing the limits of what I'm mentally capable of, and I'm excited for what's to come.

Immediately upon arrival, it quickly became clear that this wouldn't be a typical tech bootcamp experience. For starters, accommodation, as well as access to a delightful bamboo co-working space steps away from our classroom, is included in the cost of the program. How much would this villa run you in Silicon Valley?




For the last week, I've slowly been growing accustomed to returning to a regular working schedule and re-calibrating my brain to think like a computer programmer. However, the course has been structured much differently than I anticipated. As opposed to working 12 hours a day and cramming material into our brains as quickly as possible, Ruby On The Beach is founded under the principle of avoiding burnout. By taking a comfortable pace through the curriculum, taking frequent breaks to let information percolate, and starting with yoga class three days a week, class so far is legitimately delightful.

Beanbag Chair + Board Shorts + Pool = The ultimate stress-free coding environment

As our fearless leader Dan reminded us during a morning stand-up session, every concern and fear we have while coding must be appended by two words: in Bali. As in, "I'm getting really confused by this utterly impossible assignment....in Bali." This mindset puts everything into perspective; take in the gorgeous surroundings and don't get too worked up because you will figure out the solution eventually. So far, the most spectacular aspect of the class is the people. My fellow students hail from all corners of the globe and each one brings unique experiences and perspectives to the table. Our instructors have infectious positive attitudes and the bootcamp's 4:1 student to teacher ratio means an experienced and knowledgeable code monkey is never more than a shout away.


Becoming proficient in Ruby on Rails, a popular software framework for developing web applications, won't be an easy undertaking; there's a lot of ground to cover over the next two months. While taking Coursera's wildly popular Learning How To Learn to prepare for the class, one big takeaway was that if you can distill a complicated topic into segments simple enough to teach anyone, it becomes much easier to retain concepts. To quote Barbara Oakley's fantastic A Mind for Numbers"when you cultivate simple explanations by breaking down complicated material to its key elements, the result is that you have a deeper understanding of the material." For the duration of the class, I'll take one seemingly complicated concept we learned each week and try to make it simple, right here on the blog. Although this week we dove into version control using Git and even wrote our first programs in the Ruby programming language, I'll start with something devastatingly simple: the command line interface.

The Terminal


Unless you're a designer or developer, it's unlikely that you've ever opened the command line interface on your computer on purpose. But until the invention of the GUI (graphical user interface) this is how everyone interacted with computers! On the Mac operating system, it's called the Terminal and looks something like this:

Screen Shot 2015-01-11 at 8.19.24 PM

Huh? Yea, most students in class were befuddled and intimidated by this screen on Monday morning, yet by the end of the week we were all well versed in the powerful (and potentially destructive) applications of the Terminal.

If you're unfamiliar with the Terminal but comfortable with a Mac, an easy comparator is Finder's file management system. Compare the two shots below: Screen Shot 2015-01-11 at 8.32.10 PM

Screen Shot 2015-01-11 at 8.33.10 PM

Notice the similarity? The first shot is the Finder's display of the root folder on my computer, whereas the second picture shows what happens when you run the ls -l (ls = list, -l = long form) command of the same root folder from the terminal.

When properly manipulated using commands, the terminal becomes an easy and convenient way to create new folders and file systems. In the example below, I created a new folder for my Blog Content (mkdir Blog_Content), moved to that folder (cd Blog_Content), created two additional Folders for images and text (mkdir images, mkdir text), moved to the text folder (cd text), then created a text file for this post (touch ROTB_Week1.txt)

Screen Shot 2015-01-11 at 8.48.10 PM

For comparison, here is how the outcome is demonstrated in Finder.

Screen Shot 2015-01-11 at 8.55.18 PM

Boom...now you know how to make folders and files using your command line interface! Exciting, isn't it? Ok, not exactly. But while laying the foundation for more complicated applications and concepts, you have to crawl before you can run. Check back next week to learn something else about computer programming!

A September Experiment

Summer is my favorite season. I love being able to wear shorts all the time. I love the feeling of a cold beer on the back of your neck on a scorching day. I love how those hot days turn in to cool summer nights that seem to go on forever. This was one of the most fun summers I’ve ever had, but towards the end I began to realize the impact of my lifestyle. Between all that “fun”, regularly traveling for work and taking a night class, I had gotten into some bad habits that started taking a toll on my wallet and my well-being. I found myself drinking more often than not, even on weekday nights, which led to lower quality sleep and over-caffination the next day. In an attempt to regain some control over my daily habits, I underwent a September experiment: I wouldn’t drink for a whole month.

Now this might sound crazy for a 23 year old single guy living in one of the best cities in the country, but really though, how long is a month in the grand scheme of things?

It turns out a month is a very, verrrryyy long time. In the end, I made it 19 days before succumbing to a delicious IPA, but I learned quite a bit along the way. One thing I found incredibly interesting was that numerous friends who I told about my decision were considering similar stints of cutting back for a while or banishing booze altogether. If you’re interested, here’s a taste of what to expect:


People won’t understand. From a purely scientific perspective, alcohol is horrible. It’s full of empty calories, it inhibits your decision-making, and too much will make you feel horrible the next day. But alcohol has become ingrained in our culture, and it’s a staple of being a young person in a city. Instead of having to justify yourself every time someone asks if you want a drink in a bar, just nurse a seltzer and lime. Be prepared to have fun in different ways. At first, I simply had a lot less “fun.” I didn’t go to parties with my friends, I removed myself from social situations once the booze started flowing, and I generally relegated myself to being the party pooper in the corner. But as the month progressed and I realized these decisions weren’t sustainable, I realized how important it was to find sober ways to let off steam on the weekend. It’s harder to make new friends. How many times have you walked up to an attractive guy/girl or someone you don’t know, and asked if they wanted a drink to get the conversation started? Alcohol is an incredible social lubricant, and one must be creative to make new friends while not drinking.


Sleep cycle. The biggest positive impact was being able to fall asleep at the same time every night. Staying up until 3AM on the weekends had two huge negative consequences on my energy. First, I would often still wake up at 7AM on the weekends and be unable to fall back asleep, leaving me in a zombie-like state for the rest of the day. Second, it totally threw off my biological clock on a weekly basis, and it would usually take until Wednesday of the following week to finally be fully rested from a long weekend.

$$$$$$$$$. Alcohol costs a lot of money in Washington, D.C. A six pack runs upwards of $10, a drink at a bar probably averages about $5. Alcohol was a huge drain on my monthly income and it was AWESOME to remove it entirely for a few weeks.

Productive Weekends. Do you ever turn around on Sunday afternoon and wonder where the weekend went? You had some nagging tasks on your to-do list that needed to get done, but somehow the list ended up getting longer even though you had a few days off from work? Not drinking completely solved this problem for me. Waking up after 8 hours of sober sleep on a weekend morning is an invigorating feeling, and I was consistently able to seize the day. 


Once I broke the streak, the good news was I didn’t immediately return to my old ways, but in total I did end up having about 10 alcoholic drinks in the month. Looking back though, I feel more clear-headed, significantly healthier, and in more control of my daily lifestyle than I did a month ago, but I’m also looking forward to having a nice glass of red wine without making myself feel guilty.

Abstaining from alcohol isn’t for everyone. It takes a committed mind that is focused on the positive impacts in the future instead of the attitude of instant gratification that has become pervasive in today’s world. But if you arm yourself with the right mindset and learn from some of my mistakes, maybe you can cultivate the positive impacts you’re looking for.

TL;DNR - I didn’t drink for a while.