Skip to content

Instantly share code, notes, and snippets.

View adimyth's full-sized avatar
🎯
Focusing

Aditya Mishra adimyth

🎯
Focusing
View GitHub Profile
@adimyth
adimyth / inbox-and-outbox-patterns.md
Created September 24, 2025 09:40
Inbox & Outbox Pattern for message delivery

Inbox and Outbox Patterns: A Complete Guide

Core Differentiation Summary

Inbox Pattern: "Reliable Receiving"

  • Purpose: Ensure recipients can reliably consume messages
  • Location: Consumer/Recipient side
  • Problem Solved: Messages lost when recipient is unavailable
  • Use When: You need guaranteed message availability for consumers
@adimyth
adimyth / audio-splitter.py
Created September 23, 2024 18:49
Audio Splitter - split audio into chunks based on silence using pydub
import os
import aiohttp
import asyncio
import tempfile
from pydub import AudioSegment
from pydub.silence import split_on_silence
async def split_audio_on_silence_and_save(audio_url: str, output_dir: str):
# Create output directory if it doesn't exist
@adimyth
adimyth / sales.sql
Created June 9, 2024 14:35
Superset Pivot Table Test Sample Setup
CREATE TABLE sales (
sale_date DATE,
color VARCHAR(10),
region VARCHAR(10),
quantity INT,
revenue DECIMAL(10, 2)
);
INSERT INTO sales VALUES
('2016-01-01', 'Red', 'North', 1, 13.00),
@adimyth
adimyth / assignment.py
Created October 19, 2022 10:46
Some random assignment
def is_illegal(input):
words = input.split(" ")
for word in words:
if word in "ENGLISH_WORDS":
return "ILLEGAL"
for char in word:
if char in [" ", "\n", "\t"]:
return "ILLEGAL"
return None
@adimyth
adimyth / httpd.conf
Created August 9, 2022 14:28
HTTPD configuration for macos with PHP (M1)
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
@adimyth
adimyth / transfer_learning_pl.py
Created August 25, 2021 08:17
Transfer Learning with Poisson Loss (Pytorch Lightning)
from glob import glob
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
@adimyth
adimyth / stratifiedkfold_regression.py
Created January 19, 2021 11:30
StratifiedKFold Split for Regression Task
import numpy as np
import pandas as pd
from sklearn.model_selection import StratifiedKFold
df = pd.read_csv(path_to_data)
n_bins = 1+np.log2(df.shape[0]) # Sturge's rule
df["bins"] = pd.cut(df.target, n_bins, labels=False)
n_folds = 5
skf = StratifiedKFold(n_splits=n_folds)
@adimyth
adimyth / reports.md
Created November 21, 2020 06:57
Data Science Project Reports