MoreRSS

site iconThe Practical DeveloperModify

A constructive and inclusive social network for software developers.
Please copy the RSS to your reader, or quickly subscribe to:

Inoreader Feedly Follow Feedbin Local Reader

Rss preview of Blog of The Practical Developer

Git Hooks: Automating Workflows in Git

2025-08-23 17:44:54

Introduction to Git Hooks

Git is more than just a version control system. It also provides automation to improve developer productivity. One of these features is Git Hooks.

Git Hooks are scripts that Git automatically executes before or after specific events, such as commiting code, pushing to a remote repository or merging branches. They allow developers to automate tasks seamlessly within the Git workflow.

In simpler words, Git Hooks act like "triggered scripts" that run at different stages of Git's lifecycle.

The need for Git Hooks

Without Git Hooks, maintaining consistent standards across a team can be difficult. For example, the following issues may arise:

  • Developers may forget to run linting or tests before committing.

  • Sensitive files like API keys or credentials might accidentally get pushed.

  • Commit messages may lack standard formatting, making history harder to read.

Git Hooks solve these problems by automating checks and enforcing rules. Instead of relying on developers to remember every step, Git Hooks ensure quality and consistency by running predefined scripts automatically.

Types of Git Hooks available

Git provides a variety of Hooks that can be used in different stages of the workflow. These are categorized into two types:

  1. Client-Side Hooks: Triggered by operations like committing, merging, or rebasing. Example: pre-commit, prepare-commit-msg, commit-msg.

  2. Server-Side Hooks: Triggered on the server side when pushes are received. Example: pre-receive, update, post-receive.

How to find Git Hooks

When you initialize a Git repository, Hooks are available as sample scripts inside the .git/hooks/ directory. You can verify by using this command:

ls .git/hooks/

You will see files like pre-commit.sample, pre-push.sample etc. These sample files are not active by default, you can make them active by removing the .sample extension from the filename.

Example Usage of a Git Hook: Pre-Commit with Linter

Let's go through a step-by-step guide of setting up a pre-commit Hook to block commits if linting errors exist in the staged files.

Step 1: Navigate to the Hooks directory

cd .git/hooks/

Step 2: Create/Edit the Pre-Commit Hook

nano pre-commit

Step 3: Add the Hook script
Here is an example script to check for ESLint issues before allowing a commit:

#!/bin/sh

echo "Running lint checks..."

# Run ESLint on staged JavaScript files
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.js$')

if [ "$STAGED_FILES" = "" ]; then
  exit 0
fi

# Run eslint
npx eslint $STAGED_FILES
if [ $? -ne 0 ]; then
  echo "❌ Lint errors found. Commit aborted."
  exit 1
fi

echo "✅ Lint checks passed!"
exit 0

Step 4: Make it executable

chmod +x .git/hooks/pre-commit

Step 5: Test the Hook

  • Modify a .js file with linting issues.

  • Try committing:

git add file.js
git commit -m "Test commit"
  • If issues are found, the commit will be blocked until you fix them. This ensures that no developer can commit code with linting errors.

Advantages of Git Hooks

  • Automation: Automates repetitive tasks like running tests, linting, or formatting.

  • Consistency: Enforces code quality and project standards across the team.

  • Security: Prevents accidental commits of sensitive files or bad code.

  • Efficiency: Saves time by catching issues early, before code is pushed.

  • Flexibility: Hooks can be customized for different workflows and tools.

With Git Hooks in place, teams can maintain higher code quality, enforce rules effortlessly, and automate mundane checks—all directly within Git’s workflow.

And that's it! This was just a quick overview about using Git Hooks in your daily workflow.

Connect with me on LinkedIn :- Linkedin

Do check out my GitHub for amazing projects :- Github

My One-Month Journey with the Cursor Editor: An Honest Review

2025-08-23 16:01:54

In the fast-paced world of software development, our team is always looking for tools that can give us an edge. So, when we decided to adopt Cursor as our new primary editor, I was curious to see how it would stack up against my trusted VS Code and GitHub Copilot setup. After a month of using it for all my daily tasks, I have some experiences I'd like to share.

Here's the story of how that month went.

The Awkward First Week

The initial days were, as with any new tool, a period of adjustment. It's like trying to write with your non-dominant hand. Cursor looks and feels a lot like VS Code, but it's the small things that throw you off. The muscle memory I had built over years was suddenly in need of a refresh.

Changing settings felt a bit awkward at first. I found myself missing some familiar features, like the side-by-side file comparison (the diff view) I relied on. Even simple things like opening and closing the sidebar, chat, and terminal took some getting used to. I was so accustomed to my VS Code layout that I decided to stick with Cursor's default theme and just power through.

The "Aha!" Moment: It's a Canvas, Not Just an Editor

Just as I was getting into the new rhythm, things started to click. The magic of Cursor isn't in replicating VS Code perfectly; it's in its AI-first approach.

The biggest game-changer for me was the context. With Copilot, I was always vaguely aware of a context limit---a boundary I couldn't see but knew was there. Cursor feels different. It feels like a rough canvas where I can draw anything, anytime. I never once had to worry about it losing track of the conversation or the files we were discussing. This made planning new features and refactoring existing code feel incredibly fluid.

Another feature I initially overlooked turned out to be pure gold: the terminal command input box. When you go to type a command, a little search box pops up, suggesting commands you might want to run. It's brilliant! My only gripe is that it feels a bit intrusive, and there isn't an obvious way to quickly hide it when you just want to see the terminal output. Speaking of which, my go-to command for clearing the terminal screen didn't work, which was a small but persistent annoyance.

The Good, The Bad, and The AI

After settling in, I started to notice the finer details of day-to-day work.

What I Loved:

  • AI-powered Editing: Cursor truly shines when you ask it to plan and edit files. It grasps the bigger picture in a way that feels a step ahead.
  • The Infinite Canvas: As I said, not worrying about context limits is liberating.
  • Terminal Helper: That command search is a fantastic idea, even if it needs a bit of polish.

What I Missed (The Frustrations):

  • Core Editor Features: I still miss VS Code's smooth layout management and the side-by-side diff view. It's a fundamental tool I didn't realize I valued so much.
  • Extension Ecosystem: While most of my extensions were available, a key one was missing: Prompt Booster. I really relied on that extension and its MCP server to streamline my AI interactions.
  • Tool Management: In Copilot, I could use special @ commands to refer to my custom "MCP tools." Cursor allows this too, but you have to be very explicit. It doesn't intelligently pick the right tool for the job; you have to tell it. Also, Cursor seems to have a lower limit on tools (around 48) compared to Copilot (128). Deselecting all my tools in VS Code was a one-click affair; in Cursor, it's a bit more tedious.

The Verdict: Front-end vs. Back-end

My work is split between front-end and back-end development, and I noticed a difference in performance.

For front-end development (React, CSS, etc.), Cursor is fantastic. The experience feels just as good, if not slightly better, than VS Code.

But for back-end development, specifically with Java and Spring Boot, I feel that IntelliJ IDEA still holds the crown for its deep understanding of the ecosystem. The intelligence just isn't quite there yet in Cursor for complex Java projects. For Python, however, it worked great---pretty much on par with my old VS Code setup.

So, Am I Switching Back?

A month ago, I might have been tempted. Today, the answer is no.

Despite the missing features and the small annoyances, I've completely shifted to Cursor. The transition was an adjustment, but the destination was worth it. It's a trade-off: you lose some of the polished, mature features of a traditional editor, but you gain an AI assistant that feels deeply integrated, not just bolted on.

Cursor isn't perfect, but it feels like a glimpse into the future of coding. And for now, I'm happy to be living in it.

Danny Maude: 90% of Golfers Miss This One Move That Adds Effortless Distance

2025-08-23 16:01:44

Turns out, a staggering 90% of golfers are messing up one specific move in their swing, leading to that dreaded slice and iffy iron shots. Golf pro Danny Maude claims to have the secret sauce: a simple movement pattern that the pros use, which most amateurs completely bungle.

Forget a bunch of complicated swing thoughts. This lesson focuses on that one fix to help you get more distance, hit straighter drives, and finally get that pure, ball-first contact with your irons. It's all about fixing that one common flaw to transform your game.

Watch on YouTube

IGN: Dragon Quest 1+2 HD 2D Remake: Game Length, Princess of Cannock, & Tombola | gamescom 2025

2025-08-23 16:00:54

Heads up, Dragon Quest fans! The producer of the upcoming Dragon Quest 1+2 HD 2D Remake recently sat down for an interview, spilling some details about what to expect. The chat covered topics like the game's length, the Princess of Cannock's updated role in your party, and the awesome return of the Tombola lottery.

Mark your calendars, because this classic JRPG duo is getting its glow-up on PlayStation, Xbox, Nintendo Switch, and PC. The official release date is set for October 30, 2025.

Watch on YouTube

AltSchool Of Engineering Tinyuka’24 Month 6 Week 3

2025-08-23 15:56:21

We kicked off the class with a revision of our last session, where we began exploring cloud technologies in depth. You can catch up on the previous class here. Now, let’s dive into what our instructor covered this week!

Image of a laptop and a diary

The Linux Operating System

When you hear Developers, Sys-admins, or Ethical hackers talk about Linux, it might sound like a mysterious, code-driven world. In reality, Linux is one of the most powerful, flexible, and widely-used operating systems in the world powering everything from web servers and supercomputers to Smart phones and smart TVs. But how do you actually get started?

This guide provides a structured introduction to the Linux operating system, walking you through key concepts, tools, and hands-on commands to help you confidently navigate and work within a Linux environment.

Understanding Operating Systems

An operating system (OS) is the backbone of any computing device. It manages hardware, enables user interactions, and runs applications. Common OS examples include Microsoft Windows, macOS, and Linux.

Unlike proprietary systems, Linux is open-source meaning its code is freely available and maintained by a global community. It's known for stability, security, and performance, making it the OS of choice for developers, system administrators, and DevOps engineers.

What Is Linux?

Linux is not just a single OS, but a family of distributions (or “distros”) built around the Linux kernel. Popular distros include:

  • Ubuntu – user-friendly, great for beginners

  • Debian – stable and reliable

  • Fedora – cutting-edge features

  • Arch Linux – minimal and highly customizable (for advanced users)

  • Kali Linux – tailored for cybersecurity and penetration testing

Each distro has its own package manager, UI, and tools, but the core functionality remains consistent.

Setting Up Linux

To start using Linux, you can either:

  • Install it on your computer (dual boot alongside Windows/macOS)

  • Run it in a virtual machine (e.g., using VirtualBox or VMware)

  • Use a cloud-based shell like GitHub Codespaces or Replit

  • Try a live USB session without installing

Ubuntu is often recommended for beginners due to its ease of use, large community, and extensive documentation.

Your Command-Line Interface

The Linux shell is a command-line interpreter that allows users to interact directly with the OS. The most common shell is Bash (Bourne Again Shell), but others like Zsh and Fish are also popular.

The shell is where the magic happens. From creating files to automating tasks and managing systems, the command line is a powerful tool once you get past the initial learning curve.

Example:

ls -l

Lists files in long format, showing permissions, ownership, and modification dates.

Essential Linux Commands (File Operations)

File management is one of the first skills you’ll use in Linux. Some core commands include:

  • pwd – Print current working directory

  • ls – List files in a directory

  • cd – Change directory

  • mkdir – Create a new folder

  • rm – Remove a file or directory

  • cp – Copy files or directories

  • mv – Move or rename files

Example:

mkdir projects && cd projects

Creates a new folder called “projects” and immediately navigates into it.

Linux Text Editors (Command-Line Based)

Linux is famous for its text editors. These are critical for editing configuration files, scripts, and code.

  • nano – Easy-to-use, great for beginners

  • vim – Highly powerful, but comes with a steep learning curve

Example using nano:

nano myfile.txt

Opens or creates myfile.txt for editing.

Getting Help with Linux Commands

Linux has excellent built-in help systems. When you're stuck or need clarity on a command, try:

  • man – Displays the manual page of a command

man ls

  • --help – Shows command-specific help

ls --help

  • info – Another form of documentation (less common now)

You can also rely on community platforms like Stack Overflow, Ask Ubuntu, or the official distro forums.

Why Learn Linux?

Learning Linux is not just a rite of passage for tech professionals it’s a practical, career-enhancing skill. Whether you're deploying web apps, managing servers, or automating workflows, Linux knowledge puts you in control.

Real-world applications:

  • Web developers use Linux-based hosting environments

  • DevOps engineers rely on shell scripting and CI/CD pipelines

  • Cybersecurity experts build their toolkits around Kali Linux

  • Data scientists use Linux servers for distributed computing

Image of people sitting in a conference room

Final Thoughts

Linux may seem intimidating at first, but once you start experimenting with the shell, learning commands, and editing files, you’ll discover its elegance and power. It’s not about memorizing every command it’s about understanding how things work under the hood.

If you're serious about a career in tech or simply want more control over your digital tools learning Linux is a journey worth taking.

I’m Ikoh Sylva, a passionate cloud computing enthusiast with hands-on experience in AWS. I’m documenting my cloud journey from a beginner’s perspective, aiming to inspire others along the way.

If you find my content helpful, please like and follow my posts, and consider sharing this article with anyone starting their own cloud journey.

Let’s connect on social media. I’d love to engage and exchange ideas with you!

LinkedIn Facebook X