Skip to content

Instantly share code, notes, and snippets.

View MohamedElashri's full-sized avatar

Mohamed Elashri MohamedElashri

View GitHub Profile
'''
Store the branches for uproot to speed up reading root files
'''
from utils.triggers import trigger_branches
def get_branches(particles):
@MohamedElashri
MohamedElashri / preselection.py
Created August 2, 2026 08:59
pre-selection script
'''
This file aims to reduce the data sample size of B2L0barPHH decays.
Then use preselections by root
'''
import uproot
import numpy as np
import os
import traceback
from tqdm import tqdm
from utils.branches import branches
@MohamedElashri
MohamedElashri / kagi.css
Created July 23, 2026 08:23
Custom kagi CSS
:root {
--background: #282a36;
--current-line: #44475a;
--selection: #44475a;
--foreground: #f8f8f2;
--comment: #bfbfbf;
--cyan: #8be9fd;
--green: #50fa7b;
--orange: #ffb86c;
--pink: #ff79c6;
@MohamedElashri
MohamedElashri / install_qwen.md
Last active March 19, 2026 14:37
qwen mcp setup

The official script to install qwen code require root, but we can use this workaround to install qwen code without root.

Follow the steps to install Qwen Code without root, and incorporating the nvm-based Node.js upgrade (because we have very old node version)

Install Qwen Code Without Root

Step 1: Install nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
@MohamedElashri
MohamedElashri / keybase.md
Created February 26, 2026 17:44
keybase.md

Keybase proof

I hereby claim:

  • I am MohamedElashri on github.
  • I am melashri (https://keybase.io/melashri) on keybase.
  • I have a public key whose fingerprint is DC2D BFF9 D7CE 0CD9 5399 268C 41C0 F047 6F11 2C6F

To claim this, I am signing this object:

@MohamedElashri
MohamedElashri / thunderbird_linux_upgrade.md
Last active December 1, 2025 15:16
Automate thunderbird linux update

Mozilla does provide flatback and official Flatpak for thunderbird, but they are always behind release and they usually stick for long time at old versions.

I don't want also to have to check for updates and do them manually on my linux machine. so I wrote this to do automate the process

  1. Create the auto-update script: ~/.local/bin/update-thunderbird
#!/bin/bash
set -euo pipefail
@MohamedElashri
MohamedElashri / com.melashri.ssid-dns.plist
Last active October 6, 2025 00:42
Change DNS servers on Mac based on SSID
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"\>
<plist version="1.0">
<dict>
<key>Label</key><string>com.melashri.ssid-dns</string>
<key>ProgramArguments</key>
<array>
<string>/Users/melashri/.local/bin/ssid-dns</string>
</array>
@MohamedElashri
MohamedElashri / README.md
Created October 2, 2025 03:44
Cross-platform Electron Apps Detector

Electron Apps Detector

A single-file, cross-platform script that detects Electron Apps and their versions — without external dependencies.

Works on:

  • macOS (via mdfind + strings)
  • Linux (Debian, Ubuntu, Fedora, Arch, Flatpak, AppImage)
  • Windows (via PowerShell)

Usage

@MohamedElashri
MohamedElashri / syntax_highlight.py
Created September 25, 2025 16:02
Syntax Highlighting CSS Generator for Zola from Pygments Themes
#!/usr/bin/env python3
"""
Syntax Highlighting CSS Generator for Zola from Pygments Themes
Description:
Generate a combined light/dark mode syntax highlighting CSS file for Zola.
This script takes one light theme and one dark theme from Pygments and produces
a CSS file in the same format as the existing highlight.css file.
Author: Mohamed Elashri
@MohamedElashri
MohamedElashri / root_benchmark.sh
Created July 4, 2025 19:48
Benchamrk new linux machines by compiling ROOT
#!/usr/bin/env bash
# root_benchmark.sh – compile a minimal ROOT and collect build metrics
set -euo pipefail
############### Color helpers ###############
bold=$(tput bold) || true
red=$(tput setaf 1) || true
green=$(tput setaf 2) || true
yellow=$(tput setaf 3) || true