Winter Hackathon 2016

So, nailed another hackathon at SparkPost. Last month we had our winter hackathon and my team YACC Shavers, won in Partner Integration category. This is fourth consecutive winning of my team (not same members) and 3rd at SparkPost.

Winter Hackathon

During this hackathon, we built an Alexa Skill that will integrate with your SparkPost account and you can ask it questions like

Alexa, what’s my bounce rate? or Alexa, what’s my complaint rate? etc.


photoblog – quest for living begins

Quest for living begins

Cormorant, also called shag , any member of about 26 to 30 species of water birds constituting the family Phalacrocoracidae (order Pelecaniformes or Suliformes). In the Orient and elsewhere these glossy black underwater swimmers have been tamed for fishing. Cormorants dive for and feed mainly on fish of little value to man. Guano produced by cormorants is valued as a fertilizer. –  Encyclopaedia Britannica



going all lowercase

at somewhere…in we used to use all lowercase typing. it was really fun. you can just keep tying without worrying about changing case. also for some reason, it hurts my eyes and brain less to read something in all lowercase. that’s probably because i like that.

so, from today i decided to go all lowercase with my blog. it’s important to note, i can just add css to show everything lowercase using css’s text-transform. but it’s not about showing, it’s about writing. so i’ll write them in all lower. however, not sure about the old posts. i may update them occasionally or using programming tricks.


Photoblog – Howard Beach

Howard Beach


Howard Beach is an upper middle class neighborhood in the southwestern portion of the New York City borough of Queens. It is bordered in the north by the Belt Parkway and South Conduit Avenue in Ozone Park, in the south by Jamaica Bay in Broad Channel, in the east by 102nd–104th Streets, and in the west by 75th Street. The area’s houses are similar to Bayside and Hollis.

The neighborhood is part of Queens Community District 10, served by Queens Community Board 10. It is home to a large Italian-American population. The ZIP code of Howard Beach is 11414.

– Wikipedia

Ionic – get location permission on android 6

I have a pet project which is building a mobile app using ionic framework. It stopped working on my mobile after upgrading to android 6x. In android 6x, permission was moved from install-time to run-time. This means from now on, users are not granting permissions during installation of apps; rather they’ll be asked to grant permission when they want to use that particular feature in the app. It’s a great idea because if you don’t like to grant one specific permission to an app, you should still be able to use other functionalities.

So, after fixing the issue in my app, I thought it’s worth sharing with others as they may find it useful :). Fixing this issue is pretty simple and straightforward. So, let’s dive in!

Here is how my old codes look like (not exact version though, you got it :p ):

Now we can’t call LocationService.getCoords directly anymore because it’ll fail unless user already granted permission to this app to use location. So let’s ask user to grant permission.

First of all, we need to install a cordova plugin by running the following command in project directory:

cordova plugin add cordova-plugin-android-permissions --save

Then, we gonna write a method, askLocationPermission, for asking permission:

Finally, we can use it just before trying to get coords like:


  • I read somewhere this (can’t find the link) implementation is backward compatible, which makes sense because in older version of Android you’ll be already granted permission during installation (assuming you’ve mentioned locations permission correctly in your app’s manifest).
  • I’ve used promise in the new method. If you like, you can use callback pattern.
  • For list of available permissions, look at this doc.


SparkPost – Control engagement tracking with ActionMailer

In a recent post, I’ve shown how to configure action mailer to send emails through SparkPost. Today, I have faced a situation where it was needed to enable/disable tracking on a specific email. It’s to be noted that, you can globally enable or disable engagement tracking in SMTP. However, if you want to enable tracking (when globally disabled) or disabled tracking (when globally enabled) for a specific email, keep reading.


I assume, you’ve created separate mailer for each type of emails (or for at least the mails you want different tracking behavior for). Follow official doc if you’re not sure what that means or how to do it. Now, let’s configure a mailer to enable engagement tracking. For that I’ve created a HelloMailer.


In the above snippet, we’ve configured welcome email of HelloMailer, hello_mailer.rb, to enable engagement tracking. So links in your template will be automatically converted to trackable links.


  • If email is HTML (text/html), only links will be converted to a tracking URL. It’ll not convert any URLs (because you can use it for, like, anchor text and it won’t make sense to convert)
  • If email is text (text/plain), all URLs in the email will be converted to a tracking URL.
    (See the template, hello.html.erb, to see which URLs will be converted)

If you want to disable engagement tracking in an email, just set the values to false.

headers 'X-MSYS-API': { "options": { "open_tracking": false, "click_tracking": false } }.to_json

It’s that simple :).

photoblog – cooking thai 

Cooking Thai


Thai food ain’t about simplicity. It’s about the juggling of disparate elements to create a harmonious finish. Like a complex musical chord it’s got to have a smooth surface but it doesn’t matter what’s happening underneath. Simplicity isn’t the dictum here, at all. Some westerners think it’s a jumble of flavours, but to a Thai that’s important, it’s the complexity they delight in. –  Wikipedia