ruby

Avoiding bundle exec in Ruby

When I mix multiple projects in the same Ruby environment, I end up with different versions of the same gem.

2 min read

How objects send messages in Ruby

If you open IRB (interactive ruby) and type in the following expression 2 + 3, you’ll get 5. If you reverse that with 3 + 2, you’ll still get 5.

3 min read
Back to Top ↑

mindset

Permanent Happiness? Nope, I’m Just Human

Every few weeks, I hit a couple of days when I’m just in a funk. Either my energy levels dip or I feel overwhelmed. I used to think it was a problem I needed to fix. I was wrong. It’s just a normal part of being an emotionally-vulnerable human.

2 min read

How I stack skills to overcome the scarcity mindset.

Bottom Line — Worried about being replaced? If you stack your above average skills, they’ll be worth more than the value of a single highly valued skill. Here are examples where stacked skills helped me overcome fierce competition.

4 min read

Specialization is for insects — or why knowing a lot matters.

A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.

12 min read

Permission to give up on dreams

Only losers give up on their dreams, right? Common wisdom says to persevere, fight, and to never give up on your dreams. But what if the dream you have is someone else’s or no longer makes sense to you?

2 min read

On Freedom of Time

While visiting Mexico in May 2016, I found out that a normal work week consists of 6 working days at 8 hours per day. In the US and Europe, we typically have 5 working days, 8 hours per day. I might be spoiled but sometimes two days are not enough. Imagine only having 1 day off. Imagine not having any days off. It’s nerve-racking unless your full-time work is what you feel strongly about. If it’s not, then do you have enough time to engage with projects that you feel destined to do? That’s where freedom of time is an important asset.

3 min read

Life is a multi-laned highway

I was driving to work on I-25 and a realization hit me as I was switching lanes. I noticed that during my 25 mile drive, I’ll switch lanes several times before arriving at the destination. You probably do the same thing. So what? It can teach us a thing or two about looking at life. Let’s look at some scenarios.

3 min read

The comfortably numb trap

I went to Mexico in May 2016. One of my best friends was getting married, and I went down to attend the ceremony and also to get away and relax for a week. I booked an all inclusive resort that was really a dream to stay at. All inclusive includes breakfast, lunch, dinner, and entertainment. Everything is done for you; you are there to relax.

5 min read
Back to Top ↑

ruby on rails

Join tables in Rails

Let’s say you have a users table and a shows table. A user has_many shows and a show can have_many users. You’d need to set up a join table for this.

~1 min read

Adding Rails references with strong migrations gem

strong_migrations gem prevents large database tables from locking up when running database migrations. The drawback is that instead of running one easy Rails migration, you end up breaking up migrations into three parts.

1 min read

How to add apt packages to Heroku

Is there a Linux package that you want to use in Heroku? In my case, I wanted to use MediaInfo which required an apt package installation. Typically this would be an apt install mediainfo command on a Linux machine. But how do you do this in Heroku?

1 min read

Inspect Element for Rails views with xray-rails

All modern browsers have Inspect Element. When I’m working on a Rails page that loads a lot of partials, it’s a pain to hunt down where those partials are located. I wish I had Inspect Element for Rails views.

~1 min read

Using Redis as Rails Cache

Once you have Redis set up as a Rails cache backend for your project, here’s how you can explore it in the Rails console.

~1 min read

How to pass foreign keys to Rails strong params.

We have a project and a project can have many tasks. Let’s say we have a task form where a user can specify the project the task belongs to. How do you pass the project foreign key through Rails strong params?

~1 min read

Intermediate Debugging Ruby on Rails with Pry

I use Pry on a daily basis while writing / debugging code. I want to show you how to go beyond a simple breakpoint with pry. I’ll show you how I use it to learn about unfamiliar code and how to debug code.

11 min read

How to kill a rails server

I can’t be the only one who occasionally tries to start rails server and gets:

~1 min read

How Ruby on Rails Forms and Nested Forms Work.

Forms are a huge part of a dynamic website. It’s through forms that you take user input and do something with it. It’s worth taking time to understand how to build different types of forms with rails.

14 min read

Using Ajax in Rails Forms

Sometimes you want to update a form and not refresh the page. This is where AJAX (Asynchronous Javascript) comes handy.

5 min read
Back to Top ↑

software dev

Don’t leave stale commits in the main branch

The problem happens when several pull requests are merged into main and they aren’t deployed to production right away. A developer comes along and merges their pull request and deploys the main branch to production assuming only their changes were merged.

~1 min read

Changing git commit date

At times I forget to commit my changes until days later. I prefer these commits show an accurate commit date of when the work was actually done.

~1 min read

Writing good git commit messages

I’ve written crappy commit messages in the past and I’ve picked up a few tricks over time that help me write helpful descriptions.

1 min read

The self-documenting code myth

Document your code so that the next poor developer that has to extend it or fix it will be thankful you did.

3 min read

Why learning IDE shortcuts is worth it.

I lost significant productivity by relying mostly on the mouse rather than the keyboard. A few days ago, I took a few hours to ‘sharpen the saw’ and find out how other people use RubyMine (IntelliJ IDE) in their workflows.

1 min read

How to make good pull requests

Bottom Line - Don’t waste the reviewer’s time. Don’t make them over-think about things you should have provided ahead of time in the pull request description.

2 min read
Back to Top ↑

career

Prioritize connections with people over companies

All the jobs I’ve held as a petroleum engineer came from direct referrals. After I was laid off from my first job, I filled out a boatload of online applications to work at oil and gas companies.

4 min read

How much money are other software developers making?

As a software developer — you should know competitive salaries in the industry or else you might end up underpaid (sometimes severely). Having salary data will also help you ask for market-rate raises.

1 min read
Back to Top ↑

life lessons

Beyond Paycheck to Paycheck — The Freedom Money Can Buy

They say that the best things in life are free. But let’s face it, you can’t get to them if you don’t have the time. Without time, you can’t take a day off to reflect on life. That also means there’s no time for hobbies let alone, creative endeavors.

6 min read

How to ruin your life in your 20s

I’ve lived through my 20s. While I can’t tell you the exact path that will lead you to your destiny, I can list several things that will prematurely trap your life. If you’re aware of these, you’ll have a better chance of avoiding them.

4 min read

On Traveling Anxiety

It’s easier to sit in one spot rather than get up and do something different. That one spot is familiar and it is safe. A soldier friend of mine told me that during his time in the military, his unit would move locations as often as every 48 hours. His unit lived and breathed with the ability to change their location often.

5 min read

What is a reliable car and how to find one.

Gist: I bought 3 cars for people in 2 years. It might be pretty but it’s going to cost you an arm and a leg in repairs. Research and get a dependable vehicle.

5 min read

What handstands taught me about life

Bottom Line — Handstand progress is not linear. Neither are learning other skills in life. I don’t want it to be that way but that is the way it is.

3 min read

No perfect time to call — do it now!

Bottom Line — There is no perfect time to call someone. When you think about calling that person, just call them and stop over thinking it.

~1 min read
Back to Top ↑

parenting

My reflections as a father to a 14 month old toddler

Today is the second time I celebrate Father’s Day. Truth be told, even though I was a father last year, I didn’t feel like one because I was dazed and confused from taking care of a young baby. It’s since been a year and I’m happy to say that on this Father’s Day, I do feel like a Dad.

7 min read

My reflections as a father to a 9 month old baby

If I don’t write about my experiences as a father while my boy is growing up, it’s almost certain that hormones will take over and I’ll forget how I really felt. Here are some of the themes that came up.

9 min read

Essential items for a newborn

If I had to become a first time father again, here are the essentials I’d get for my newborn. I used all the items I list here.

6 min read

Hear the raw truth from these online parenting communities

While you can ask parents around you about their parenthood experiences, you’ll seldom hear the raw truth. You won’t hear things like — I don’t know if I’d do it again. Or how about — my life has never been the same and I’m depressed. Or how about — it caused my divorce. You’ll mostly hear It’s hard but oh my god, it’s worth it.

1 min read

Earbuds keep me sane when babies cry and scream

After watching my few week-old newborn for 7 hours, I was drained. I’m not going to sugarcoat it — I was going through hell as he was fussing, crying, and intermittently sleeping.

1 min read
Back to Top ↑

tech

Applications I use on a Mac

I used to be a Windows guy. I had to switch over to Mac for software development. I disliked iOS. It took about a year of installing the right apps and getting used to the Mac.

2 min read

How to setup Wireguard VPN from a private VPS.

Bottom Line — using a VPN is great for online privacy. Hosting it on a VPS ensures your IP won’t be blacklisted. It’s easy to setup with an automated script.

3 min read

Make PowerPoint file size 4 times smaller

Bottom Line — Your powerpoint file doesn’t need to be 100 megabytes. You can quickly batch compress images within it to a reasonable size.

1 min read
Back to Top ↑

health

Too cool for earplugs, too deaf to hear.

Bottom Line — Our generation will have a record number of those who will be hard of hearing. It’ll be our own fault. Use ear plugs!

5 min read

Why you’re afraid and the Amygdala

I stumbled upon a really great video that went into describing how the Navy Seals train their troops to handle high stress situations. They have a unique approach which is focused on exposing the soldiers to fearful situations, and having them react in a sensible matter. I highly recommend watching the video below, but if you’re short on time, I’ll summarize some of the things I got out of it:

1 min read

Getting started with wet shaving

Bottom Line — Tired of using triple blade blades? You don’t have to. Here’s how you can shave just like your grandfather did.

4 min read

Each hour of sleep before midnight is worth two

Over time, I’ve noticed that if I go to sleep closer to 10:30 pm, and sleep until 6:00 am (7.5 hours total), I wake up feeling refreshed in the morning. If I go to bed closer to 12 am, and sleep until 7:30 am, I have a harder time waking up and have a greater propensity to continue sleeping. The total time spent sleeping stays the same at 7.5 hours, but the time intervals change. Let’s take a closer look.

2 min read
Back to Top ↑

management

How I renewed my PMP certification

Bottom Line — You don’t need to spend money on courses to renew your PMP certification. Here’s exactly how to do it on the cheap.

5 min read

PMP Exam Lessons Learned

Bottom Line — I took the PMP exam in 2015. Not much changed today in the exam world in 2020. Here are all the strategies I used to pass the exam. Here’s what I would teach my younger self.

11 min read
Back to Top ↑

branding

Use a QR Code to provide contact info

You’re exchanging phone numbers. You have to repeat your phone number and your name and name. Why not simply have the other person scan a QR code that automatically imports your contact info.

~1 min read
Back to Top ↑

web development

How HTTP Works

The internet is made up of millions of interconnected computers that send and receive messages. That’s it.

2 min read

Interact with JQuery from the browser console

I recently stumbled on this technique where you can load JQuery for ANY page and write JQuery commands right in the browser console. This is great for debugging and exploration.

~1 min read
Back to Top ↑

linux

Writing a descriptive motd

Have you ssh’d into a production server and had no idea what to do next? For example, I ssh’d into a production Rails server but didn’t know how to access Rails console. It wasn’t straight forward. I was met with a black screen and a white cursor.

1 min read

How to use the Command Line Interface

Becoming a software developer forced me to learn the command line interface. At first, I strongly resisted. Coming from windows GUI — the command line looked like an ugly remnant of 1980s computing.

6 min read
Back to Top ↑

sql

Precision vs Scale in SQL

When I set a table column to decimal, I tend to forget the difference between precision and scale.

~1 min read
Back to Top ↑

skills

How to overcome the imposter syndrome through teaching.

Bottom Line — Imposter syndrome will kill your self-confidence in your craft. The solution is to teach your craft. Teach through writing or video work. You don’t have to be an expert to begin.

3 min read

How using a voice recorder helps me generate creative ideas

Bottom Line — Ideas come to my head randomly. If I don’t jot them down, I forget them. I use a voice recorder app to collect them and transcribe them later. That’s how I generate creative ideas and reduce the stress of having to remember a lot.

2 min read
Back to Top ↑

experiences

The heroes journey in a MuckFEST 2018 obstacle course

I went to MuckFest MS 2018 5K obstacle course in Denver.  It was my third time running it. A friend, my girlfriend, and I went together and were part of a bigger team of at least 20 people that started the run at 9 am.

4 min read
Back to Top ↑

craft

You are not your code

The code you write today will be killed off in the future. You are not the code you write.

1 min read

Don’t let originality paralyze your creativity

The problem is sitting down to write and thinking I have nothing original to say. You start a blog and a few weeks later you forget about it. Someone told you that original thought is a prerequisite for creative work.

3 min read

Ira Glass on the gap between ability and taste

Ira Glass is the producer of the radio and television series “The American Life”. His take on bridging the gap between taste and ability deeply resonated with my own journey with writing.

1 min read
Back to Top ↑

javascript

Back to Top ↑

profiles

Fedor Emelianenko on Life, Sport, and Fitness

Fedor “The Last Emperor” Emelianenko is a Russian MMA fighter. There’s no doubt he’s a great fighter, but that’s just one piece that makes up his total package.

10 min read

Scarface — The Rise and Fall of Tony Montana

I watched Scarface (1983) several years ago and thought that it was just a violent action movie. I didn’t give it a second thought and was satisfied with just watching it once. I saw it on Netflix and decided to give it another chance. This time around, the movie had a deeper meaning to me and it wasn’t about the violence and the 1980’s drug wave, but it was instead a deeper look into human nature. I’m not sure if that was the intention that Brian De Palma and Oliver Stone had when making this movie, but this is what I felt.

6 min read
Back to Top ↑

docker

Deploy Wireguard VPN in Docker

Most VPN setups assume that the entire server will be dedicated to the VPN. By using docker containers, I can run a vpn and other applications all on one single server.

4 min read
Back to Top ↑

design

Use larger font size for readability

Bottom Line — Content begs for easy readability. Think about if your text size is too small and therefore hard to read for the average reader.

2 min read
Back to Top ↑