KatPadi's Point

Category: Codes

Heartbreaker: Yet Another Space Invaders Clone

I created something out of boredom: http://stuff.katpadi.ph. So… obviously it’s a game. It’s not original. It’s nothing amazing. It’s a space invaders clone with a twist. I am still enhancing the “twist” part. There’s a heartbreaker (it’s a pig!). It rips the hearts out. But the hearts still give hearts anyway. It’s silly, I know. There are…

Autocomplete Using Redis

Usually, when we implement suggestions in autocomplete input fields, we query directly to our database. Relatively, LIKE queries in MySQL are slower. So why not autocomplete using Redis? Disclaimer: This is a basic Redis solution for “just-trying-it-out” purposes only. Motivation As I’ve mentioned, I got annoyed by the slow autocomplete results of an app that I…

Ruby Gem That Makes Your Model Activatable

Aktibibo is a simple Ruby gem that makes your model activatable. It allows an ActiveRecord model to be declared as “activatable” thus providing scopes for querying and filtering objects. Of course, the module adds convenience methods for setting an instance as active, inactive or deactivated. As an additional feature, it also saves the activation and deactivation dates because it uses datetime DB…

Policy Object Adventures

A few months back, I wrote something about my service object adventures to handle extraction of a business logic from a Rails model or controller. Recently, I got introduced and experimented on the concept of policy object. Policy objects are pretty much just like service objects. In fact, from what I understand, policy object is actually…