Taka’s blog

A software engineer's blog who works at a start-up in London

Testing Patterns for External Web API Access

Writing automated tests that entail external Web API access isn't an easy job. You may suffer various things such as API rate limits, slowness due to network overheads, little control over API's behaviour, and so on. I'll introduce four pa…

Use JavaScript Custom Errors Better

In the JavaScript world, pitfalls are everywhere; one of them is error handling. This post introduces a good way of using JavaScript's custom errors. TL;DR necojackarc/extensible-custom-error enables you to define handy extensible custom e…

Write Hubot Scripts Easily with Babel ES201x

Using Babel, you can easily write Hubot Scripts with ES201x. TL;DR Configure your Hubot following necojackarc-sandbox/hubot-babel-es201x Code your Hubot Scripts in src/bot directory with Babel ES201x Prologue I happened to need to make a b…

Make Images Watermarked with RMagick (+ CarrierWave)

Summary This post explains how to cover images with an array of a watermark. Plus, I show an example how to use it with CarrierWave. What is Watermark? Watermark is an image which often covers sample images. I made a sample of fotowa*1 log…

Separate JavaScript Easily and Moderately from Rails with WebPack

Introduction To dive into the world of front-end, I came up with an idea to separate JavaScript easily and moderately from a Rails project. Some have already shared various ideas, but I found them too much or required more than couple of t…

Went to RubyKaigi 2016 as a Ruby Sponsor

I went to RubyKaigi 2016 that was held at Kyoto International Conference Center in Kyoto, Japan from Sep. 8th to 10th. rubykaigi.org My company, PIXTA, was one of the Ruby sponsors*1 of this conference. I had plans on the Saturday so I was…

Cool Way to Control Retry with ActiveJob

ActiveJob brings benefits but it has just simple features yet. So, I've made a module with the APIs published officially to add some features of controlling retry. An Issue about Retry ActiveJob doesn't have enough features about retrying …

Have made a gem to retrieve holidays from Google Calendar

I've made a gem to retrieve national holidays from Google Calendar with simple interface. github.com What motivates me is there is no suitable gem for my purpose as far as I can see. What I want to do What I want to do and some features th…

How to read a text file in batches with Ruby

When I was reviewing my colleague's source, I found awful code in his program. Like this: File.open("./production.log") do |file| results = {} file.readline # skip header file.each_line do |line| key, value = process(line) results[key] = v…