Dimas Maulana

Dimas Maulana

Developer

Welcome to my website! I am a developer with a current focus on React and Go. My experience encompasses both front-end and back-end development, enabling me to design and develop seamless and efficient applications.

GIT Commit Message Naming

Introduction

A well-structured commit message is crucial for maintaining a clean and readable project history. The Conventional Commits specification provides a standard format for commit messages, making it easier to generate changelogs, automate versioning, and improve collaboration. This document outlines the naming conventions and structure for Git commit messages.

Git Gitlab Flow

GitLab Flow is a set of best practices for using Git with GitLab, combining elements of Git Flow and GitHub Flow to support various workflows. It emphasizes the use of feature branches for development, with integration to GitLab’s CI/CD pipeline for continuous testing and deployment.

Production Branch

flowchart TB
a-->b-->c-->d-->e
f-->g
c--deployment-->g
g-->h
a[development]
b[development]
c[development]
d[development]
e[development]
f[production]
g[production]
h[production]

Environtment Branches

flowchart LR
a-->b-->c-->d
e-->f-->g-->h
i-->j-->k
a--deploy to\npre-prod-->e
c--deploy to\npre-prod-->g
e--production\ndeployment-->j
a[staging]
b[staging]
c[staging]
d[staging]
e[pre-prod]
f[pre-prod]
g[pre-prod]
h[pre-prod]
i[production]
j[production]
k[production]

Release Branches

flowchart LR
a-->b-->c-->d-->e
a-->f-->g
c-.-chery-pick-.->g
d-->i
a[main]
b[main]
c[main]
d[main]
e[main]
f[2.3-stable]
g[2.3-stable]
i[2.4-stable]

User Roles Naming

Effective user role naming is essential for managing access control and permissions in systems, applications, and organizations. Well-structured role names enhance clarity, consistency, scalability, and security, ensuring that responsibilities and access levels are accurately represented.

Key Principles

  1. Clarity – Role names should be self-explanatory and easily understood by all stakeholders.
  2. Consistency – Maintain uniform naming conventions across all roles to prevent confusion.
  3. Scalability – Design role names that accommodate future expansions or modifications.
  4. Security – Ensure that role names reflect the appropriate access levels without exposing sensitive information.

Example Role Hierarchy

flowchart LR
a[Site Visitor] --> b[Former Member]
a --> c[Registered Member]
a --> d[Known Visitor]
a --> e[Unknown Visitor]
c --> f[Premium Member]
c --> g[Trial Member]

Explanation

  • Site Visitor: A general user without an account.
  • Former Member: A user who previously had an account but is now inactive.
  • Registered Member: An active user with a registered account.
    • Premium Member: A user with a paid or upgraded membership.
    • Trial Member: A user on a temporary trial plan.
  • Known Visitor: A non-registered user recognized through tracking mechanisms.
  • Unknown Visitor: A completely anonymous user.

Conclusion

Adopting structured and meaningful role names improves system usability, security, and scalability. Organizations should define roles carefully to align with business needs while maintaining clear distinctions in access levels.

How to Get Yesterday's Date in Bash on Mac and Ubuntu

In Bash scripting, there are various ways to retrieve yesterday’s date on both Mac and Ubuntu systems. Below, we’ll demonstrate two different methods for each operating system.

Mac:

Method 1: Using date with -v option

1
2
yesterday=$(date -v-1d +%F)
echo "Yesterday's date on Mac: $yesterday"

In this method, we use the -v option with the date command to subtract 1 day from the current date and format it as %F, which gives the date in YYYY-MM-DD format.

Shell Bash Export Variable

It looks like you’re trying to use the eval command in a Bash script to export variables loaded from a dotenv file using the shdotenv tool. This is a common practice for setting environment variables from a configuration file. Here’s an explanation of what this code does:

  1. shdotenv is likely a command or script that reads a dotenv file (usually named .env) and sets environment variables based on the key-value pairs defined in that file. Dotenv files are commonly used to store configuration variables for applications.

0%