Skip to content

Instantly share code, notes, and snippets.

@moneuron
moneuron / cleanup-deployments.sh
Created May 26, 2026 13:52
Script to clean up old GitHub Deployments in a repository.
# GitHub Repository Configuration
REPO="OWNER/REPO_NAME"
# Fetch all IDs at once, skip latest (first one)
IDS=$(gh api --method GET "/repos/$REPO/deployments?per_page=100" | jq -r '.[].id' | tail -n +2)
delete_deployment() {
ID=$1
REPO=$2
gh api --method POST /repos/$REPO/deployments/$ID/statuses \
@moneuron
moneuron / cleanup-actions.sh
Created May 26, 2026 13:51
Utility script to quickly delete all workflow runs from a GitHub repository using the GitHub CLI (gh).
# GitHub Repository Configuration
REPO="OWNER/REPO_NAME"
# Fetch all workflow run IDs (loops through pages)
IDS=$(gh api --paginate --method GET "/repos/$REPO/actions/runs?per_page=100" \
| jq -r '.workflow_runs[].id')
delete_run() {
ID=$1
REPO=$2
@moneuron
moneuron / quiz_shuffle.py
Last active December 23, 2024 16:32
-› takes a '.txt' file as input and creates a new '.txt' file with a specified number of randomly selected questions from the input file.
import sys
import argparse
import random
def main():
inp = get(sys.argv[1:])
allq = open_txt(inp)
try:
num = int(input("Number of Questions: "))
except:
@moneuron
moneuron / unique.py
Created December 23, 2024 16:28
-› reads a CSV file and print all the unique values for each column!
import pandas as pd
# Load the CSV file
file_path = input("Enter the path to your CSV file: ")
df = pd.read_csv(file_path)
# Iterate over each column and print unique values
for column in df.columns:
unique_values = df[column].unique()
print(f"Unique values in column '{column}':")
@moneuron
moneuron / translate.py
Created December 23, 2024 16:28
-› translates any .txt file from any language without charchter limitation!
###################
INPUT_L = 'en'
OUTPUT_L = 'fa'
###################
from deep_translator import GoogleTranslator
print("BE SURE TO RUN THE PROGRAM IN THE SAME DIRECTORY AS THE FILE")
path = input("file name: ")
out = path.split('.')[0]
output = ''