Skip to content

Instantly share code, notes, and snippets.

View shahin-you's full-sized avatar
💭
Mikhazam

Shahin Youssefi shahin-you

💭
Mikhazam
  • WISI America (formerly Inca Networks)
View GitHub Profile
@shahin-you
shahin-you / pre-commit
Last active March 9, 2024 07:44
pre-commit hook to find `TODO` comments + simple check for code folder vs test folder changes.
#!/bin/sh
# Check for "TODO" in staged files
TODO_FOUND=$(git diff --cached --name-only --diff-filter=AM | grep -E '\.(cpp|c|cc|h|hpp)$' | xargs -r grep -l 'TODO')
if [ ! -z "$TODO_FOUND" ]; then
echo "Warning: TODO found in the following files:"
echo "$TODO_FOUND"
echo "Consider addressing the TODOs or creating tickets for them before committing."
# Uncomment the next line to block the commit until TODOs are addressed
@shahin-you
shahin-you / BuildEnvDockerFile
Created February 23, 2025 23:33
Docker file for C++ build environment using GCC/G++
# Use Ubuntu 24.04 as the base image
FROM ubuntu:24.04
# Avoid interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
LABEL Version="1.0.0"
LABEL Description="Complete C++ Build Environment with GCC 13.3.0"
ENV HOME=/root
USER root
@shahin-you
shahin-you / dmake
Created February 23, 2025 23:35
dmake script for running commands in docker container
#!/bin/bash
# Get the directory containing this script
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
# Go one level up to find the project directory
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
# Container version
CONTAINER_VERSION=1.0.0
# Set the Docker image name and docker file name
DOCKER_IMAGE_NAME="build_env:${CONTAINER_VERSION}"