Skip to content

Instantly share code, notes, and snippets.

View ahmedelgabri's full-sized avatar
🤔
...

Ahmed El Gabri ahmedelgabri

🤔
...
View GitHub Profile
@ahmedelgabri
ahmedelgabri / config.md
Created October 5, 2024 09:58 — forked from pascalpoitras/config.md
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@ahmedelgabri
ahmedelgabri / rename-pictures.sh
Created October 2, 2024 09:10 — forked from jart/rename-pictures.sh
Shell script for renaming all images in a folder
#!/bin/sh
# rename-pictures.sh
# Author: Justine Tunney <jtunney@gmail.com>
# License: Apache 2.0
#
# This shell script can be used to ensure all the images in a folder
# have good descriptive filenames that are written in English. It's
# based on the Mistral 7b and LLaVA v1.5 models.
#
# For example, the following command:
-- vim: tabstop=2 shiftwidth=2 expandtab
-- We almost always start by importing the wezterm module
local wezterm = require 'wezterm'
-- Define a lua table to hold _our_ module's functions
local module = {}
-- Returns a bool based on whether the host operating system's
-- appearance is light or dark.
function module.is_dark()
@ahmedelgabri
ahmedelgabri / Makefile
Created September 18, 2024 14:08 — forked from alexedwards/Makefile
Boilerplate Makefile for Go projects
# Change these variables as necessary.
main_package_path = ./cmd/example
binary_name = example
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
@ahmedelgabri
ahmedelgabri / CMD.md
Created August 25, 2024 10:46 — forked from OXY2DEV/CMD.md

🔰 A beginners guide to create custom cmdline

showcase

Ever wanted to know how noice creates the cmdline or wanted your own one?

No one? Guess it's just me 🥲.

Anyway, this post is a simple tutorial for creating a basic cmdline in neovim.

@ahmedelgabri
ahmedelgabri / compress_video
Created August 22, 2024 10:42 — forked from trvswgnr/compress_video
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in
@ahmedelgabri
ahmedelgabri / nix-markdown-pandoc.nix
Created July 25, 2024 15:08 — forked from rasmus-kirk/nix-markdown-pandoc.nix
A report built with Pandoc, with continious compilation
{
description = "A report built with Pandoc, with continious compilation.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
#!/usr/bin/env python3
import os
import argparse
import sys
def combine_markdown_files(folder_path, output_file, max_size):
current_size = 0
try:
@ahmedelgabri
ahmedelgabri / README.md
Created March 13, 2024 09:03 — forked from lawrencejones/README.md
Produce build telemetry from a MacBook

MacBook system information

You can run this script in order to extract various runtime and system measurements from a MacBook that might be relevant to performance.

This is a sample output:

{
  "id": "3d0f3c61-480e-4ace-9a65-c6e09ffd2dbd",
 "timestamp": "2023-12-12T19:38:27.013103Z",
@ahmedelgabri
ahmedelgabri / falsehoods-programming-time-list.md
Created March 3, 2024 14:22 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).