No Programming, No Life
Dec 14, 2016 • 2 min read

RSpec tesiting for rake task [Ruby on Rails]

I summarized the procedure of the RSpec test in this article. Since I summarized it as simple as possible, please read through those who are trying to create Rake task for the first time.  Read →

Dec 14, 2016 • 2 min read

What are mock and stub used in unit testing?

This article is a simple explanation of mock and stub used in unit testing.  Read →

Dec 14, 2016 • Less than a minute read

Export PostgreSQL table to CSV [COPY command]

As PostgreSQL COPY command is convenient, I wrote this tips. This command is easy and really useful, so please try it.

$ psql
-- Export product table to CSV file
\copy (SELECT * FROM products ORDER BY id) TO '/tmp/produccts.csv' DELIMITER ',' CSV HEADER
# If you want to see the csv including Shift-JIS(Japanese)
nkf -s /tmp/products.csv > /tmp/converted.csv
 Read →

Nov 29, 2016 • 5 min read

Effective Procedures to Setup new Mac El Captain For Rubyist

This article describes effective procedures for Rubyists to setup new Mac OS El Captain.  Read →

Nov 29, 2016 • Less than a minute read

How to use alternate created_at / updated_at column

This article shows 2 ways for “How to use alternate created_at/updated_at column.  Read →

Nov 26, 2016 • Less than a minute read

Prevent 'ArgumentError: invalid byte sequence in UTF-8' on Faraday[Ruby]

This is a tips to prevent “ArgumentError: invalid byte sequence in UTF-8”.

Sample Code

url = "http://sample.com/search?q=%A0"

Faraday.get(url)
ArgumentError: invalid byte sequence in UTF-8

Faraday.get(url.force_encoding(Encoding::BINARY))
=> #<Faraday::Response:0x007fd8ca826ce8...
Happy Hacking!  Read →

Nov 19, 2016 • 1 min read

Using Redis for caching & session management with Ruby on Rails

This article shows about cacing data & session management with Ruby on Rails.  Read →

Nov 19, 2016 • Less than a minute read

Use Elasticcache with Elasticbeanstalk

This article describes how to use Elasticcache with Elasticbeanstalk.  Read →

Nov 13, 2016 • 2 min read

How to upload gziped file to S3 from URL[Ruby]

This article shows how to upload gziped file to S3 from URL by Ruby.  Read →

Nov 12, 2016 • 3 min read

Deploy Rails App to ElasitcBeanstalk on wercker

I published “wercker step” to deploy an application to Elastic Beanstalk instance using AWS CLI. morizyun/eb-deploy - GitHub This aritcle describes how to use the wercker step and outline of the step.  Read →