Monthly Digest

My blog posts of July, 2018.

JGit: Protect Branches on Git Server

If you're using JGit for your Git server, you can combine Git config (.git/config) and a customized pre-receive hook to protect branches on a specific Git repository.

Git: Understanding Git Config

The format of Git internal configuration file (.git/config) is very simple: it has multiple sections, each of which contains multiple options. An option is indeed a key-value pair...

SEO: Improve Blog Ranking in Google Search

This post explains how to improve your blog ranking in Google Search when you know nothing about SEO. I'm using my Jekyll blog as an example, to implement everything step-by-step: add robots.txt, sitemap, structured data; improve title tags, meta description; use Google Search Console...

Create Element with Polymer 2

Want to create your first web element with Polymer 2? This post provides a step-by-step tutorial for you: Polymer CLI, useful websites, Polymer element's structure, dependency management, AJAX request and more.

JavaScript Cheat Sheet

A simple JS cheat sheet for newbies, containing the basic syntax of commonly used statements: variable, class, array, JSON, ...

Python 3 Cheat sheet

I occasionally write Python scripts, but I always forget those very basic syntax. So I'm writing this Python 3 cheat sheet.

Java Server on Raspberry Pi

A step-by-step guide for installing Java server on Raspberry Pi: install Raspbian OS, install JRE, configure SSH, transfer data, and setup Java server with Systemd.

Create Systemd Unit File for Java

This post explains how to create a systemd unit file for Java, so that you can run your Java application as a service in Linux. It also explains the structure of a service file, and tells your the useful commands after service's creation.

Method Execution In Multithreading

Today I met some multithreading problems. Many Java syntax become very confusing in a multithreading environment. So I created a mini Java program, and wrote this study note to clarify the unclear methods. This blog post will go through the following steps:

  1. Source code and execution
  2. Understand Thread#join()
  3. Understand logic sharing
  4. Understand variable sharing