In other words: setting up resolvers in Rails, Webpacker and Jest

If you’ve been writing code for Javascript via Webpacker and Rails, you might be coming across thing like requiring javascript code from some directory structure you and your team has built. But then, requiring javascript code in deeply nested folders would eventually look something like this:

import HelloService from "../../../service/HelloService"
import Image from "../../../assets/svgs/hello.svg"

Wouldn’t it be simpler if it looked like this:

import HelloService from "Services/HelloService"
import HelloSvg from "Assets/svgs/hello.svg"

To achieve this, just add an resolve.alias configuration:

const { resolve } = require("path");
const { config } = require("@rails/webpacker");
const rootJavascriptPath = config.source_path;module.exports = { resolve: {…

Super simplified version! WAOW

“Hmm, okay so we want to send BTC programmatically? It shouldn’t be that hard, let me read some docs and look at libraries”


TL;DR credit card expired with Godaddy. Godaddy auctioned and my wife’s

Oh well, the situation sucked, a domain name that I kept for a decade, auctioned off just like that. I didn’t keep tabs on such an asset. Luckily my email addresses and inbox contained nothing that important.

My wife’s, also held for a decade, was auctioned off too. That one is more important, she used the gmail quite professionally in her career as a photographer.

You could say that Godaddy has all the legal right to enforce these things since we did sign up and agree to the way the run things. But it doesn’t mean it’s…

I saw a friend of mine, get mobbed in Twitter, due to a statement they said that was taken out of context. I felt sad.

When someone contradicts you, they’re in a sense attacking you. Sometimes pretty overtly. Your instinct when attacked is to defend yourself. But like a lot of instincts, this one wasn’t designed for the world we now live in.

— Paul Graham

It feels so wrong not to defend yourself online, primal instinct dictates that we defend ourselves when attacked. …

For the past few months, I’ve been spending 5–9 hours every Saturday and Sunday with Navi.

Just the 2 of us, so you know what that means.

Artist at work

Elain has shoots during the weekends and she’s booked to the brim for the next few months. As for the rest of this year, she’s already getting bookings as far as December.

When Elain is out for a shoot, it’s hard to just lounge around wherever she’s shooting. When Navi sees Elain, it’s hard for him because he’s not getting attention from her. Also, he’s a little picky on what he eats, and…

Some time in your software development career, you’ll hear this question in one form or another from your users.

Is there a way to bulk upload with excel sheets?

We all know Excel runs the business world, so you’re bound to get this request soon enough. There are different ways in approaching how to build this feature, but here’s some notes on our experience building and maintaining Excel uploads.

Our usual go-to strategy

Gems we use are:

gem "sidekiq"
gem "spreadsheet"
# This is bread and butter for us to make reusable business-logic
gem "light-service"
# We extensively use this across apps and use…

When you’ve got some spare time, sometimes it’s okay to not think up of a side project.

Sometimes it’s okay to watch youtube videos and twitch streamers.

Sometimes it’s okay to let your son pour rice grains on random pots and pans in the living room.

Sometimes it’s okay to play video games.

Sometimes it’s okay to spontaneously dine out with your wife and kid.

Sometimes it’s okay to draw and scribble random things on your notebook.

Sometimes it’s okay to take a trip out of the country, do it once a year.

Sometimes it’s okay to just stare at…

Someone asked this over in Hacker News. Building something in the scale of Paypal, Stripe, Transferwise is daunting; ‘daunting’ is an understatement. Having worked on a remittance startup and being exposed to bits of this undertaking, I was excited to share to him why it’s hard to dethrone the giant.

Granted, the company I work for is nowhere near the size of Paypal, I figured the outline might be helpful. Here was my reply:

Why does Paypal still exist?

They nearly charge 5% of the transaction on an average. Sometimes it’s more than the wire transfer charges. There has been…

You’ve probably Google’d these words:

next previous activerecord rails

You probably have an ActiveRecord model and you want to get the next/previous (chronologically speaking) record from that record, where you can chain more conditions via a .where clause.

The search results would be dated 2012–2014, and they would tell you to make your own methods. They’re correct. Here’s another little snippet on how to do that:

# app/models/your_model.rbclass YourModel  scope :next_created, -> (created_at) do
.order(created_at: :desc).limit(1)
scope :previous_created, -> (created_at) do
.order(created_at: :asc).limit(1)
def next_created
def previous_created
end# Now you…

I’ve been working remotely for almost 2 years now for a local company called Bloom Solutions.

Cash Savings

  • 1500PHP/week for gas. Full-tank.
  • 600PHP/week for parking.
  • 1500PHP/week for eating out. Usually the food expenses are: 1.) breakfast (if I wake up a little late), 2.) lunch 3.) and some light snack before the ‘traffic jammed’ commute/drive home. I can bring this down to 750PHP/week if I bring packed lunch and some sandwiches.
  • Some weeks I drop the car and commute instead, which costs me 400PHP/week.

Combined, this hits our bank accounts with a range as low as 4.6k/month to as high as 14.4k…

Ace Subido

Father. Husband. Likes video games. Senior Software Engineer @ Bloom Solutions. I like writing notes to myself.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store