Move To Hugo

Hugo I knew it yesterday I hadn’t known this software until yesterday. This is really easy to build a static site than jekyll, and I decided and did to move Hugo. Motivation I can quickly change the theme. That is really important for me. Many cool themes are in Hugo Themes. The way to Manage GitHub repo has changed and I don’t understand git submodule well, have to learn it.

Read More

Upgrade Rails to 5.1.4 and webpacker

I deployed Rails app as v5.1.4 from v5.0.6 today. During deployment, I felt a wee bit frustrated because of Webpacker. As historical reasons, the app dependents on browserify(-rails) even though it depends on Webpack(er), and browserify is in devDependencies in package.json. Webpacker does yarn install in rails assets:precompile, but it doesn’t install devDependencies if NODE_ENV=production. I found the solusion for it, just add NPM_CONFIG_PRODUCTION=false to the assets precompile statement. And I read issues and pull-requests on webpacker, it seems to regard compilation dependencies should be under dependencies not devDependencies.

Read More

画像リサイズの仕組み

昨日 ActiveStorage をいじってて、ふと「画像の resize ってどういう仕組みなのかなー?」と気になったので少しだけ調べてた。

しょうもないけど絶対忘れるのでメモ

Read More

Try ActiveStorage with S3

I tried Rails new feature ActiveStorage Rails version is v5.2.0.beta2 Default service is Disc, and I tried S3 at this time. config/storage.yml stays almost as it is. Add mini_magick gem in my Gemfile to use resizing feature. Add aws-sdk-s3 gem to upload to and read from S3. Set config.active_storage.service = :amazon in config/environments/development.rb Run bin/rails active_storage:install and a migration file copied from active_storage. After running bin/rails db:migrate, active_storage_attachments and active_storage_blobs tables are created.

Read More

英日翻訳について思うこと

今朝、趣味で英語->日本語に翻訳をしたので、日頃思ってることを twitter とかに書こうかと思ったが、長くなりそうだったのでこちらに。

特に技術系の翻訳記事はかなり違和感のある文章をそのまま載せてるケースがあり、まったく頭に入ってこないので自分は比較的元の文章を見に行くことが多いので、そういうことを避けるために自分なりに気をつけている英日翻訳のコツを書き出してみる。

Read More