Tech Notes

This is my personal user-experience notes of using Linux Distributions, GNU softwares, scripting and Web development. The contents such as wikis, commands, codes, etc. on this page and sub pages are supposed to be used by your own consideration at your own risk. So, doing your own research and climbing learning curve is recommended. I am not responsible for anything bad happened to you or your computing system due to using any content from here.

CSS overflow-wrap: break-word

When designing for the web, one small but important detail is how browsers handle very long words or strings of text. On mobile screens especially, an unbroken word can stretch beyond the viewport and cause horizontal scrolling — something no user enjoys.

The modern solution is simple: add this to your stylesheet:

~
body {
  overflow-wrap: break-word;
}

With this rule in place, the browser can gracefully break long words when needed, ensuring text always stays inside the screen width.

Submit Data to Google Form via Custom Html Form

Disclaimer: This post is written purely for educational and exploratory purposes, and as a personal technical record. The method described — submitting data to Google Forms via a custom HTML form — is not officially supported by Google, may stop working without notice, and should not be relied on for production use or sensitive data collection. I do not encourage or endorse misuse, automation of fake submissions, or attempts to bypass login-restricted forms. Please use responsibly and at your own discretion.

Turning Google Sheets into a Simple JSON API with Google Apps Script

Google Sheets isn’t just for storing data—it can also act as a lightweight database for your projects. With a few lines of Google Apps Script, you can transform your spreadsheet into a JSON API that any web app, static site, or script can consume.

In this post, we’ll walk through a script that reads a Google Sheet and serves its content as JSON.

Why Use Google Sheets as a JSON API?

  • No extra server required: Everything runs inside Google Apps Script, hosted by Google.
  • Friendly interface: Non-technical users can update the data directly in Google Sheets.
  • Free & fast: For small projects, it’s cost-effective and quick to set up.
  • Integration ready: Your frontend or external services can fetch structured data via a simple endpoint.

The Code

Here’s the complete Google Apps Script function:

My Neovim Setup

Neovim is a fork of aiming to improve the codebase, allowing for easier implementation of APIs, improved user experience and plugin implementation.

Setting up Neovim

This is my neovim setup of personal preference. The setup or configuration is all included in ~/.config/nvim/init.lua file. Except native user settings, the following plugins are installed:

  1. savq/paq-nvim plugin manager written in Lua.
  2. hrsh7th/nvim-cmp auto-completion.
  3. neovim/nvim-lspconfig language server protocol (LSP).
  4. L3MON4D3/LuaSnip snippet engine.
  5. rafamadriz/friendly-snippets snippets.
  6. nvim-treesitter/nvim-treesitter treesitter for better syntax highlighting colors.
  7. marko-cerovac/material.nvim material colorscheme.
  8. nvim-telescope/telescope.nvim telescope search tool.
  9. nvim-tree/nvim-tree.lua side bar file explorer.
  10. nvimdev/indentmini.nvim indent line.
  11. windwp/nvim-ts-autotag autoclose and autorename html tag.

The above plugins are not all plugins required because most of them require other plugins as dependencies. For example, nvim-cmp requires the followings:

Git Rebase

git rebase

 

In the following scenario, the safest option is using git pull --rebase or setting configuration by git config pull.rebase true.

Analysis of the scenario

  1. Current state on Remote:
    file aaa.txt exits and file bbb.txt does not exist yet.
  2. Current state on Local:
    file aaa.txt does not exist and file bbb.txt has been created.

In above scenario and local repository on the computer, git push will fail with the following message:

Controlling Running a Script

We often need to run our script avoiding certain situations like the followings.

  1. Avoiding running a script as ROOT.
  2. Avoiding running a script in background.
  3. Avoiding running a script if the script is already running.
  4. Avoiding unnecessary remains exist.

 

Avoiding running a script as ROOT

It is undesirable if a script was accidentally run as ROOT while the script is supposed to be run as normal user. To avoid this situation:

Myanmar Unicode and Disqus Comment Box

If you type Myanmar language online, you’ve probably met this problem:
Everything’s fine — until you type ေ (the “E-vowel”) second time (E.g. the second ေ in ကောင်း ေကာင်း) in a Disqus comment box. Suddenly, the whole page reloads and even Disqus comment box disappears.

This is not a random glitch. It’s a combination of:

  • The Myanmar typing system, where the vowel ေ is traditionally typed before the consonant (e.g., type ေ then က to get ေက) for typing ကောင်း.
  • Unicode order rules, which expect consonants first (e.g., ကောင်း).
  • A Disqus input handling bug, which misinterprets the second typing of ေ as a “Back” or “Reload” key sequence in certain browsers.

The result? Your carefully typed comment is gone.

Build Script for Cloudflare and Hugo

In Cloudflare Pages → Project Settings → Build Configuration, I can set the Framework preset to Hugo, the Build command to hugo, and the Build output directory to public. That’s the default when selecting Hugo.

However, when using Pagefind, even though I can set the Build command to hugo && npx pagefind --site "public", it’s not quite satisfying. This is because, on every build, Cloudflare runs hugo, installs Pagefind, and then runs npx pagefind --site "public" again — which takes a long time.