necojackarc’s blog

A software engineer's blog who works for a web service company

Decent Use of JavaScript Custom Errors

The original post was published on October 10th, 2018, by me in Japanese. In the JavaScript world, pitfalls are everywhere; one of them seems to be error handling. This post shows one way to use JavaScript's custom errors decently, which i…

Write Hubot Scripts Easily with Babel ES201x

The original post was published on Mar. 12, 2017, by me in Japanese. 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/bo…

Make Images Watermarked with RMagick (+ CarrierWave)

The original post was published on Jul. 8, 2016, by me in Japanese. 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 ima…

Separate JavaScript Easily and Moderately from Rails with WebPack

The original post was published on Nov. 29, 2015, by me in Japanese. 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 vario…

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…