Fear of rejection

I remember the last time I’ve had panic attacks. We were new to the work, and I knew about it in theory, but did not have first-hand experience with it. This was the first time, but I gave my 100% and researched the heck out of it but the client rejected our work.

I was devastated. As a result, I kept putting off having them check our work again. The project dragged on, and as a result, is delayed by a long time.

Oddly enough, I know that it’s all in my head. That failure in one thing isn’t really a failure if I learn from it and turn it into a success.

I know that. In theory.

I’ve tried to acknowledge the fear. Many times. By calling it out.

Nobody is perfect. You can make mistakes. You’re just scared.

But I guess I still need lots of practice.

Minitest with Kaminari

While converting my tests from FactoryGirl.create to FactoryGirl.build_stubbed, I ran into trouble with Kaminari. Here’s how I fixed it.


Kaminari functions by adding .page() (and some other methods) at the end of your ActiveRecord call chain. A typical example of paginating via Kaminari is as follows:

class UsersController < ApplicationController
  def active_users
    @users = User.active_users.page(params[:page])

This is a problem when you’re trying to stub out the return of the AR call to return an array. Here’s a corresponding test that would fail:

require 'test_helper'

describe UsersController, "#active_users" do
  test "success" do
    users = FactoryGirl.build_list :user, 3
    get :search, term: "admin_user"
    assert_response :success

Because users is just a regular array here, and Kaminari tries to call .page() on the array, it would fail with a NoMethodError: undefined method `page’ for # because Array#page isn’t defined.

Trying to stub out .page() by users.stubs(page: users) would give you ActionView::Template::Error: undefined method `model_name’ for #. And so on, as long as you’re using Kaminari-specific methods.

The solution

The solution is pretty simple (but took me 2+ hours to research). Call Kaminari.paginate_array on the FactoryGirl.build_list.

users = Kaminari.paginate_array FactoryGirl.build_list :user, 3

From the documentation:

Kaminari::paginate_array method converts your Array object into a paginatable Array that accepts page method.

For now, I’m putting the Kaminari.paginate_array inside the test, but long term, it makes sense to put it in the controller code. This way, even if we change User.active to return an array, no other code would break. Then again, that’s why we have tests, right?

Protein Bar Attempt #2

After almost 2 weeks, my protein bars attempt #1 are finally done so I mixed up a new batch with the following recipe:

  • 300g Quaker Oats Quick Cook Oatmeal
  • 3 scoops Optimum Nutrition Double Chocolate Flavor
  • 340g Ludy’s Sweet and Creamy Peanut Butter
  • 250ml Surebuy Coconut Cream

This batch turned out better than last time. The consistency is closer to what I want.  For now, this will be my go to recipe. I’ll probably play around with using a different brand of peanut butter and/or oatmeal.

Where there was smoke (Me and my friends’ fire survival story)

As some of you probably already know, there was a fire at Prince David Condo, a building in front of Ateneo Friday afternoon.

What most of you probably did not know, my friends and I was there. We were at the top most floor, right below the roof deck.

Photo lifted from https://anc.yahoo.com/news/fire-breaks-out-at-qc-condo-055800824.html
Photo lifted from https://anc.yahoo.com/news/fire-breaks-out-at-qc-condo-055800824.html

Thankfully, we all survived.

Here’s our story, from my POV.

Continue reading Where there was smoke (Me and my friends’ fire survival story)

High Protein Vegetables Tuna Recipe

I’ve been cleaning up my diet lately. One of the hardest things that I’m constantly facing is getting more vegetables in my diet. Next to that is getting my daily protein needs.

I discovered a hack (sort of) that addresses both, doesn’t take much time and is financially viable for my budget. The secret is canned vegetables and canned tuna. It’s not ideal, I know, but it’s better than nothing.

Here’s one of my favorite combinations (that I just had literally minutes ago): Continue reading High Protein Vegetables Tuna Recipe

Homemade No-bake Protein Bar Notes

I followed this homemade no-bake protein bar recipe. Here are my notes on it.

  • I used the following brands:
    • Coconut cream: Surebuy
    • Whey Protein: Optimum Nutrition, Double Chocolate Flavor
    • Peanut Butter: Ludy’s
    • Oatmeal: Quaker Oats Quick Cook Oatmeal
  • I only had 200g of oatmeal so, initially, I halved the recipe.
  • It looks like the oatmeal absorbs too much of the “wet” ingredients that 200g of it warranted the full recipe.

The modified recipe is as follows:

  • 200g Quaker Oats Quick Cook Oatmeal
  • 76g or 2.5 scoops Optimum Nutrition Double Chocolate Flavor
  • 1 tbsp Honey
  • 340g Ludy’s Sweet and Creamy Peanut Butter
  • 250ml Surebuy Coconut Cream

I’ll know for sure how it would taste like tomorrow when the bars freeze over, but the ones that stuck to my hands while I was mixing it would suggest that it should be good.


Now I’ve had a couple of bars, I can comment on the taste and texture.

I was satisfied with the taste. Peanut butter with some hint of coco. I couldn’t separate the chocolate flavor at all.

The texture was okay, though I’d like to improve more on it. It turns out that 200g of oatmeal wasn’t enough to accommodate the rest of the wet ingredients. I’ll probably bump it up to 300g, but definitely not 400g. I’ll play around with other “fillings” such as almonds, granola, etc.

Based on the rate of consumption, I guess one batch would last me a week and a half. The ingredients costed me, maximum Php 250, not counting the protein powder. Not bad.

Fair programmer market value

I sometimes get asked “As a programmer, how much is my per hour rate?” or in another form “What’s my market value?”

The simple answer to this is that your market value is whatever price you agree to get paid for. That sounds like very passive so I’ll rephrase it.

Some people would say I'm overpaid, but I'm not. I'm paid exactly what the market will bear, which means I'm paid what I'm worth. - s2e04
Some people would say I’m overpaid, but I’m not. I’m paid exactly what the market will bear, which means I’m paid what I’m worth. – s2e04

Anything’s value, according to a market, is the highest price someone is willing to buy it at and the lowest price someone is willing to sell it at. It’s what we call the market clearance.

Your value is whatever price you agree to sell yourself at. If your price is above market clearance, then you might be overpriced. If your price is below the market clearance, then you are underpriced.

I would argue that on a personal level, the market clearance should not matter much on fields where there are massive demand and not enough supply (e.g. programmers). The market can usually bear the price.

Then the matter of market value becomes agreeing upon a price and that increasing your market value is simply agreeing to a price higher than your current.

Setting a higher price is simple, but not easy. What makes it so hard to ask for more?

Of cats and cups

Everything in this world is a duality. It’s both something and nothing, ethical and unethical, rational and irrational, good and bad.

The secret to happiness and success is by realizing that the world is both black and white and that humans interpret which shade of gray it is.

The cup is both alive and dead and the cat half-empty and half-full.