Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
"""
Parse a listing like the one in stdin and write each file to disk.
"""
import re
import sys
from pathlib import Path
_PATH_LINE = re.compile(r"^/.*:$")
#!/usr/bin/env python3.10
"""
Enhanced file expansion using Jinja2 templates with flexible functionality.
Example usage:
wget this file, apply chmod +x jinja_expand, and run it like this:
jinja_expand template.md > expanded.md
@OhadRubin
OhadRubin / expand.py
Last active May 26, 2025 12:25
Python script to expand file contents with placeholders
"""
Example usage:
python3.10 expand.py template.md > expanded.md
This will expand all {file_path} placeholders in template.md with the actual file contents
and write the result to expanded.md
```template.md
@OhadRubin
OhadRubin / eLOCm.md
Created May 26, 2025 08:55
eLOCm.md

please port this implementation of epinets into jax keep it as similar as possible to the original code. you are provided with a jax implementation of mnist to help you.

  1. come up with a plan that includes a estimated #LOC modified or e#LOCm.
  2. if a line requires more than 30 e#LOCm then you should divide it into two parts or more. This is so I could see what you are doing. The division allows me to see your output, you should say what you did after each modification and think ahead to the next modification.

Strict Script Generation Task: File Partitioning with Shell Script

Primary Objective: Your sole task is to generate a shell script containing a function definition and a sequence of function calls designed to partition the provided original_file_content based on the rules specified in the explanation. This partitioning must be complete - all original content (except imports) must appear in exactly one output file, with no content omitted or duplicated.

Inputs Provided:

  1. - Text describing how the original file should be partitioned.
  2. <original_file_content>: The content of the file to be partitioned.

Instructions - Follow Sequentially and Precisely:

@OhadRubin
OhadRubin / desmos_prompt.md
Created May 1, 2025 12:51
desmos_prompt.md

don't use comments, just give me something i can paste into desmos (don't use comments) Subscripts may only contain letters and digits. ',' is not allowed prefer u_{1a} = 0.117 over u_1a = 0.117

multi-character functions are not allowed if we want to define z(x)=x+2 we could do the following

@OhadRubin
OhadRubin / create_toc_prompt.md
Created April 22, 2025 08:06
create_toc_prompt.md

Suppose we were to write a 1000 pages book called {name} what would the table of content be like? It should have 3 parts, each part will have 6 sections, each section will have 4 chapters, each chapter will have 3 headings. give me the full table of content with all 216 headings, 72 chapters, 18 sections and 3 parts.

your output should be in the following format

Table of Contents: {name}
PART 1: <part_title>
Section 1.1: <section_title>
Chapter 1.1.1: 
@OhadRubin
OhadRubin / peer.html
Created April 21, 2025 14:00
peer.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PeerJS Messaging Demo</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/peerjs/1.5.4/peerjs.min.js"></script>
<style>
body {
@OhadRubin
OhadRubin / reasoning_prompt.md
Created April 21, 2025 09:08
reasoning_prompt.md

"Just do it" - Prompt

Please implement <blank>

"Into natural language" Prompt

Please describe it in natural language in such a way to it will be able to be reconstruct exactly
@OhadRubin
OhadRubin / find_largest.sh
Created March 24, 2025 12:22
find_largest.sh
#!/bin/bash
dirs=($(sudo du -h --max-depth=1 ~/ | sort -h | awk '{print $2}' | tail -n 10 | head -n 9))
for dir in "${dirs[@]}"; do
if [ ! -d "$dir" ]; then
echo "Warning: $dir is not a directory or doesnt exist"
continue
fi
echo "Largest file in $dir:"