Skip to content

Instantly share code, notes, and snippets.

View Michaelliv's full-sized avatar

Michael Michaelliv

View GitHub Profile
@Michaelliv
Michaelliv / SKILL.md
Created December 22, 2025 21:53
Debate skill for Claude Code - simulate expert panel debates
name description
debate
Simulate expert panel debates on any topic. Suggests personas based on context and facilitates structured discussions with conflicting viewpoints.

Expert Panel Debate

You are facilitating an expert panel debate. Follow this process:

Step 1: Gather Context

package com.github.michaelliv.characters
import com.github.michaelliv.extensions.charSetUnion
import com.github.michaelliv.extensions.openCharSetOf
import com.github.michaelliv.extensions.toCharSet
object Unicode {
val EXCLAMATION_MARK = openCharSetOf(
'!', // U+0021 EXCLAMATION MARK = factorial = bang
@Michaelliv
Michaelliv / usefull_commands.md
Created May 2, 2024 09:30
Useful commands for investigating code bases with LLMs

Copy Code to Clipboard

This command searches for specific file types in the current directory and its subdirectories, extracts the code content (excluding comment lines), and copies the result to the clipboard.

Command Template

find . -type f \( -name "*.<file_extension_1>" -o -name "*.<file_extension_2>" \) -print0 | xargs -0 -I {} sh -c 'echo {}; grep -v "^//" {}' | pbcopy

Example (JavaScript)

@Michaelliv
Michaelliv / copy_objects_by_last_modified.py
Created April 7, 2022 05:58
Copies all objects from source s3 path to target s3 path, filters results by last modified date
from datetime import datetime
from typing import Optional, Callable
import awswrangler
import boto3
import pytz
def copy_bucket_content(
source_s3_uri: str,
@Michaelliv
Michaelliv / clear_bucket_by_min_date.py
Created March 29, 2022 18:18
Deletes entire bucket content based on bucket names, object prefix and minimal date
from datetime import datetime
from typing import Optional
import boto3
import pytz
def clear_bucket_by_min_date(
bucket: str,
prefix: Optional[str] = None,
import multiprocessing as mp
from typing import Dict
POISON = "POISON"
LOCK = mp.Lock()
class MultiprocessTermCounter:
def __init__(self, num_workers: int = mp.cpu_count()):
self.queue = mp.Queue()
def count_terms_line_by_line():
total_count: Counter = Counter()
for line in open(DATA_PATH, encoding="utf8"):
line_count = line.lower().split(' ')
total_count += Counter(line_count)
def count_terms_in_memory():
total_count: Counter = Counter()
with open(DATA_PATH, encoding="utf8") as f:
# Read the file into memory
lines = f.readlines()
# Lower case each line, split by space
for line in lines:
terms = line.lower().split(' ')
total_count += Counter(terms)
@Michaelliv
Michaelliv / bench.py
Last active September 15, 2020 11:40
Python run time benchmarking utility
import time
from typing import Callable, Set, Iterator, List
def bench(fn: Callable, warm_up_iterations: int = 10, test_iterations: int = 100, verbose: bool = False):
for i in range(warm_up_iterations):
start_time = time.time()
fn()
end_time = time.time() - start_time
if verbose:
print(f"warm up #{i} [{end_time}sec]")
import kotlin.math.abs
import kotlin.time.ExperimentalTime
import kotlin.time.measureTime
@ExperimentalTime
fun simpleBench(testIterations: Int = 1000, warmUpIterations: Int = 5, printSteps: Boolean = false, action: ()-> Unit): Double {
val results = ArrayList<Double>()
println("Running Simple Bench")