Skip to content

Instantly share code, notes, and snippets.

View hasannasrul's full-sized avatar
🎯
Focusing

NASRUL HASAN hasannasrul

🎯
Focusing
  • Tata consultancy services
  • new delhi
View GitHub Profile
@hasannasrul
hasannasrul / DE-Revision.md
Created October 7, 2025 16:30
Data Engineer interview revision

Python & Data Engineer Interview Cheat Sheet

This cheat sheet contains runnable Python examples across Core Python, ETL/Data Processing, Algorithmic Thinking, Pandas/SQL, and Real-world Scenarios.


1️⃣ Core Python

Word frequency in string

🕵️‍♂️ Synthetic Monitoring with Selenium + CDP (Analytics-Safe)

This script is a lightweight synthetic monitoring tool using Selenium + Chrome DevTools Protocol (CDP) that allows you to load a web page without triggering internal or external analytics scripts.

Ideal for enterprise use cases where you want to:

  • Monitor uptime or check page content
  • Avoid polluting internal analytics data
  • Block self-hosted tracking domains

@hasannasrul
hasannasrul / aws_cache.py
Last active February 12, 2025 17:21
LLM Caching mechanism
import boto3
import hashlib
from dotenv import load_dotenv
from botocore.exceptions import ClientError
load_dotenv()
# Initialize DynamoDB client
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('gen_cache')
import csv
def position_to_row_col(csv_file_path, byte_position):
try:
with open(csv_file_path, 'r', encoding='utf-8') as file:
csv_reader = csv.reader(file)
current_pos = 0
for row_num, row in enumerate(csv_reader, start=1):
for col_num, cell in enumerate(row, start=1):
import csv
import re
def has_special_characters(text):
# Define a regular expression to match non-alphanumeric and non-Markdown special characters
special_char_pattern = re.compile(r'[^a-zA-Z0-9\s,.!?;:()"\'*?_~`\-+=<>{}\[\]\\\\|/^#]', re.UNICODE)
return bool(special_char_pattern.search(text))
def find_rows_with_special_characters(file_path):
@hasannasrul
hasannasrul / mysql_cheat_sheet.md
Created November 15, 2020 07:34 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH