谷歌 Adsense 申请及在 Hugo 中的配置

我的博客目前利用 GitHub pages 服务托管,不需要付费,但是博客的图床选用了腾讯云的对象存储,每个月还需要付一笔流量费用。为了保持收支平衡,也为了好玩,决定申请谷歌的 Adsense 一试。本文记录申请 Adsense 以及在 Hugo 博客中配置 Adsense 的过程。

JPEG Image Orientation and Exif

The other day I came across a strange bug during work. My colleagues gave me some photographs taken with a smartphone. On their machines (Windows 7), all the photos were shown correctly in landscape mode. However, when I checked those photos, I found that some of those photos were shown in portrait mode (rotated 90 or 270 degrees) or upside-down (rotated 180 degrees).

I was curious what happened and learned about Exif and all its related stuff.

Convert PIL or Numpy Image to Bytes without Saving to Disk

Introduction

Sometimes, we want an in-momery jpg or png image that is represented as binary data. But often, what we have got is image in numpy ndarray or PIL Image format. In this post, I describe how to convert numpy image or PIL Image object to binary data without saving the underlying image.

Fast Movement and Navigation Inside Vim or Neovim

Introduction

One key spirit of Vim is to accomplish something in as fewer key strokes as possible. When you repeat a command a few times in order to perform an action, you need to ask yourself if there is a better way to do it. Only in this way, can you make progress in mastering Vim. For example, when your want to delete five lines of texts, if you press dd five times, you are certainly doing it the wrong way. After looking up the Vim manual, you know that you can use 5dd or d4j: you only need three keystrokes instead of ten!

The other day, I saw a post in a forum asking for help on how to quickly move the cursor inside a buffer. After using Neovim for nearly a year, I would like to share what I have learnt about fast movement and navigation inside Neovim/Vim.

几把机械键盘试用体验

6.18 快到了,加上在家里使用的 IKBC C87 青轴声音太大,敲击费力,所以动了换一把更加静音,触发力度更小的键盘的心思。在京东和淘宝上入手了多款键盘试用,不得不说,一把好的键盘真的是难选啊。自从去年双十一入手了一把 Leopold 红轴键盘以后,其他的键盘真的很难入我的眼睛了。试用过的几把键盘以及感受如下: