Skip to content

Instantly share code, notes, and snippets.

View aymenkrifa's full-sized avatar

Aymen aymenkrifa

View GitHub Profile
# Overrides 'pip' based on the virtual environment.
# Uses 'uv pip' if the environment was created by 'uv', otherwise uses 'pip'.
function pip() {
RED='\033[0;31m'
GREEN='\033[0;32m'
BOLD='\033[1m'
NC='\033[0m'
if [[ -n "$VIRTUAL_ENV" ]]; then
@aymenkrifa
aymenkrifa / connect_airpods.sh
Created December 21, 2023 20:14
Shell script for AirPods connect in Ubuntu system
#!/bin/bash
MAC_ADDRESS="XX:XX:XX:XX:XX:XX" # Replace with your AirPods' MAC address
# Check if AirPods are already connected
if bluetoothctl info $MAC_ADDRESS | grep -q "Connected: yes"; then
notify-send "AirPods are already connected."
else
# Connect to AirPods
bluetoothctl connect $MAC_ADDRESS
notify-send "Connecting to AirPods..."
@aymenkrifa
aymenkrifa / database_connection.py
Created March 2, 2023 19:08
Establish a database connection using SQLAlchemy with Pandas
import pandas as pd
from sqlalchemy import create_engine, URL
from sqlalchemy.sql import text
url_object = URL.create(
drivername="DIALECT+DRIVER",
username="username",
password="password",
host="host",
database="database_name",