Skip to content

Instantly share code, notes, and snippets.

View tamadamas's full-sized avatar
☯️

Tomas Tamadamas tamadamas

☯️
View GitHub Profile
@tamadamas
tamadamas / install-pre-push.sh
Created November 10, 2026 08:16 — forked from stefansundin/install-pre-push.sh
Git pre-push hook to prevent force pushing the master/main branch.
#!/bin/bash
# This script will install a Git pre-push hook that prevents force pushing the master/main branch.
# There are three variants that I have built:
# - pre-push: prevents force-pushing to master/main.
# - pre-push-2: prevents force-pushing to master/main depending on the remote (you need to edit the file!).
# - pre-push-3: prevents any type of pushing to master/main.
# Set the desired version like this before proceeding:
# FILE=pre-push
# Single repo installation:
@tamadamas
tamadamas / zig
Last active November 13, 2025 18:06
anyzig wrapper with default zig version (It's writen with AI, so free to suggest ANY improments)
#!/usr/bin/env sh
# Anyzig wrapper script with default version support
# Compatible with: Bash, Zsh, Fish, and other POSIX shells
#
# Installation:
# 1. Save this script as 'zig' (or any name you prefer)
# 2. Make it executable: chmod +x zig
# 3. Place it in your PATH before the actual zig executable
# 4. Set ZIG_DEFAULT_VERSION environment variable (optional)
@tamadamas
tamadamas / zz.fish
Created March 19, 2025 19:04
Zig function fish wrapper
function zz -d "Simple Zig wrapper function"
set -l cmd $argv[1]
set -e argv[1]
switch "$cmd"
case test
zig build -fincremental test
case lint
zig build -fincremental lint
case run
@tamadamas
tamadamas / bash.sh
Last active April 9, 2024 09:17
Fedora sync time
# Make sure services works
sudo timedatectl set-ntp true
sudo systemctl enable chronyd.service
sudo systemctl restart chronyd.service
# Check status
systemctl status chronyd.service
chronyc -n sources
grep -e ^server -e ^pool /etc/chrony.conf
@tamadamas
tamadamas / bash_strict_mode.md
Created April 2, 2024 19:58 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@import "modern-normalize";
:root {
line-height: 1.5;
}
h1, h2, h3, h4, h5, figure, p, ol, ul {
margin: 0;
}
@tamadamas
tamadamas / README.md
Last active March 24, 2024 18:38
Switch between AstroVim v4 and Kitty
@tamadamas
tamadamas / golang.md
Last active April 17, 2020 11:20
Go modules and direnv