Skip to content

Instantly share code, notes, and snippets.

View nongvantinh's full-sized avatar
💭
I may be slow to respond.

Nông Văn Tình nongvantinh

💭
I may be slow to respond.
  • 08:25 (UTC +07:00)
View GitHub Profile
@nongvantinh
nongvantinh / git_merge_tool.py
Last active May 26, 2025 06:41
This script automates the process of merging a feature branch into a development branch with rebasing. It checks out the feature branch, rebases it onto the development branch, and then merges it into the development branch. It also validates that the branches exist before performing any operations. The script can be run in dry-run mode to simul…
#!/usr/bin/env python3
# USAGE:
# This script automates the process of merging a feature branch into a development branch
# with rebasing. It checks out the feature branch, rebases it onto the development branch,
# and then merges it into the development branch. It also validates that the branches exist
# before performing any operations. The script can be run in dry-run mode to simulate the
# operations without making any changes to the repository.
# 1. Make the script executable:
@nongvantinh
nongvantinh / Dockerfile
Last active May 20, 2025 08:31
Building a Windows Docker image on Windows OS
# escape=`
# https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile#escape-character
# https://hub.docker.com/r/microsoft/dotnet-framework-sdk
ARG FROM_IMAGE=mcr.microsoft.com/dotnet/framework/sdk:3.5-20241008-windowsservercore-ltsc2022
FROM ${FROM_IMAGE}
SHELL ["cmd", "/S", "/C"]
ADD https://aka.ms/vscollect.exe C:\collect.exe
@nongvantinh
nongvantinh / generate-otp.cpp
Last active April 10, 2025 05:01
C++17 implementation for one-time passwords. It provides HMAC-based and time-based implementations of one-time passwords.
// Compile: g++ generate-otp.cpp --std=c++17 -Wall -Wextra -o otp_generator
// Run: ./otp_generator
#ifndef ONE_TIME_PASSWORD_H
#define ONE_TIME_PASSWORD_H
#include <string>
#include <vector>
#include <ctime>