Skip to content

Instantly share code, notes, and snippets.

View danield137's full-sized avatar

Daniel Dror danield137

View GitHub Profile
@danield137
danield137 / main.py
Created March 20, 2024 22:11
Python autoinstall missing dependencies
import subprocess
import sys
import importlib
def install_modules(modules):
"""Install multiple Python modules using pip."""
subprocess.check_call([sys.executable, "-m", "pip", "install", *modules])
def install_dependencies(required_modules):
def wrapper(func):
@danield137
danield137 / analyze.py
Last active May 6, 2024 22:03
Analyze NSG flow logs
import abc
from collections import defaultdict
import json
import os
import pandas as pd
import time
from dataclasses import dataclass
from typing import Any, Dict, List, Optional, Tuple
import requests
.create table Person (Id: int, name:string)
.ingest inline into table Person <|
1, John
2, Mary
3, Alice
4, Jacob
5, Julie
.create table Restaurant (Id: int, name:string, city:string)
@danield137
danield137 / test-mcp.sh
Created May 3, 2025 06:46
List MCP tools locally (node stateful mcp)
#!/bin/bash
# Debug mode
set -x
# Step 1: Initialize a session
echo "Step 1: Initializing session..."
# Add the required Accept headers
RESPONSE=$(curl -s -i -X POST http://localhost:3000/mcp \
@danield137
danield137 / DataReaderUtils.cs
Created May 7, 2025 08:02
DataReaderToJsonElements
public static class DataReaderUtils {
public static List<JsonElement> ConvertDataReaderToJsonElements(this IDataReader reader)
{
var result = new List<JsonElement>();
// Get column names
var columnNames = new string[reader.FieldCount];
for (int i = 0; i < reader.FieldCount; i++)
{
columnNames[i] = reader.GetName(i);
@danield137
danield137 / projectm.instructions.md
Last active June 2, 2025 21:53
Instructions Template
applyTo **

Project M Coding Guidelines

This document outlines the coding standards, architectural patterns, and best practices for the Project M codebase. It's designed to help new engineers quickly understand our approach and contribute effectively to the project.

Project Overview

Project M is a markdown-based project management tool that combines the hierarchical organization of Workflowy, the intelligent assistance of ChatGPT, and the dashboard capabilities of tools like Jira. The project uses a modular architecture to handle document parsing, task management, AI integration, and dashboard generation.