Skip to content

Instantly share code, notes, and snippets.

View alileza's full-sized avatar
🏠
Working from home

Ali Reza Yahya alileza

🏠
Working from home
View GitHub Profile

List Google Drive Files Using Google Workspace CLI

Prerequisites

  • Node.js installed
  • A Google Cloud project

Step 1: Install Google Workspace CLI

Claude Code Internals: How Context Assembly & Processing Works

Analysis of the extracted source code of Claude Code CLI v2.1.88 (@anthropic-ai/claude-code)


Architecture Overview

Claude Code is a sophisticated agentic loop wrapped in a terminal UI (~1,884 TypeScript files). The core data flow:

Deep Dive: ΞΌ-law (Mulaw) Audio Encoding

ΞΌ-law is a companding algorithm used in telephony (North America, Japan). It compresses 14-bit linear PCM into 8-bit samples, giving better quality for quiet sounds at the expense of loud sounds.

Mulaw Byte Structure:

Bit:    7    6    5    4    3    2    1    0
      +----+----+----+----+----+----+----+----+
      | S  |    Exponent   |     Mantissa     |
 +----+----+----+----+----+----+----+----+
#!/bin/bash
# Desktop organization script
# Organizes files by type and month created
DESKTOP="/Users/alirezayahya/Desktop"
cd "$DESKTOP"
echo "Starting desktop organization..."

🐎 Going Cowboy

Definition

Going cowboy is when engineers bypass established processes, guardrails, or compliance gates to push code or infrastructure changes directly β€” often under pressure, urgency, or just to "get it done."

While it might seem faster in the moment, in a regulated environment (like finance) this creates high risk, including:

  • ❌ Bypassing required reviews (e.g., four-eyes principle).
  • ❌ Skipping compliance or audit checks.
  • ❌ Creating blind spots for regulators and security teams.
  • ❌ Potential fines or legal consequences if untracked changes are discovered.
@alileza
alileza / add_env.py
Last active August 29, 2023 16:55
Add env on grafana dashboard for all prometheus query
import argparse
# Create an argument parser
parser = argparse.ArgumentParser(description="Modify JSON file by adding environment variable")
# Add arguments
parser.add_argument("input_file", help="Path to the input JSON file")
parser.add_argument("output_file", help="Path to the output JSON file")
# Parse the command-line arguments
@alileza
alileza / uninstall
Created August 19, 2023 21:27
Uninstall soundflower from mac
#/bin/sh
sudo rm -rf /System/Library/Extensions/Soundflower.kext
sudo rm -rf /Library/Extensions/Soundflower.kext
sudo rm -rf /Library/Receipts/Soundflower*
sudo rm -rf /var/db/receipts/com.cycling74.soundflower.*
sudo rm -rf /Applications/Soundflower
@alileza
alileza / 001_posts.md
Created July 11, 2023 10:07
#001 Unleashing the Power of User Space in Linux Kernel: Revolutionizing Software Engineering πŸ’‘πŸš€

Unleashing the Power of User Space in Linux Kernel: Revolutionizing Software Engineering πŸ’‘πŸš€

The bridge between seamless computing and user-friendly experiences

Introduction:

In the vast realm of the Linux kernel, user space components hold the key to a seamless, efficient, and captivating computing experience. However, realizing the true potential of user space requires continual advancements in software engineering. From enhancing performance and security to delivering captivating user experiences, engineers are constantly innovating to optimize user space within the Linux kernel. In this blog post, we delve into the challenges faced in user space and explore the exciting solutions that are reshaping the landscape of software engineering.

The Challenge: Bridging the Gap between Kernel and Applications πŸŒ‰

@alileza
alileza / view_rbac.sh
Last active May 3, 2023 20:44
`sh view_rbac.sh system:serviceaccount:default:user-a`
#!/bin/bash
USER=$1
NAMESPACE=$2
check_permissions() {
resource=$1
namespace=$2
can_create=$(kubectl auth can-i create $resource --as=$USER --namespace=$namespace)
492.65 219.25 l
S
Q
q
0 J
0 j
0.5 w
0.50196 0.50196 0.50196 RG
827 219.25 m
598.79 219.25 l