Skip to content

Instantly share code, notes, and snippets.

View usametov's full-sized avatar

Ulan Sametov usametov

  • Asta Nova Enterprise Solutions
View GitHub Profile
@usametov
usametov / multiples-files-ts.md
Created July 8, 2025 13:39
azure deployment notes

When deploying a TypeScript Azure Function App with multiple files (e.g., a handler and a library) to Azure, the issue of functions not appearing in the Azure Portal often stems from incorrect project structure, configuration, or deployment settings. Below, I'll guide you through the steps to properly deploy a TypeScript Azure Function App with multiple files, ensuring the functions are visible in the Azure Portal.

Common Issues and Solutions

The problem you're facing—functions not appearing in the Azure Portal—can occur due to:

  1. Incorrect project structure: Azure Functions expects a specific folder structure, especially for TypeScript projects where compiled JavaScript files are used.
  2. Missing or incorrect function.json files: For the v3 programming model, these files define the function's bindings and entry points.
  3. Improper compilation or deployment: TypeScript files need to be compiled to JavaScript, and all
@usametov
usametov / dewarping-text.md
Created July 3, 2025 21:15
text de-warping

Applying differential and computational geometry to read letters on a warped piece of paper is a fascinating problem that involves modeling the paper’s deformation, reconstructing its 3D shape, and extracting text from a distorted surface. This task has applications in document analysis, historical manuscript restoration, and computer vision. Below, I’ll outline the key concepts, existing work, and related projects in this domain, focusing on differential and computational geometry approaches. I’ll keep the explanation concise yet comprehensive, as you’ve expressed curiosity without specifying a desired length.

Key Concepts

  1. Differential Geometry: This field provides tools to describe the geometry of surfaces, such as a warped piece of paper, using concepts like curvature, tangent planes, and geodesics. For a warped paper, differential geometry helps model the surface as a smooth, non-Euclidean manifold, allowing us to understand its deformation mathematically.
  2. Computational Geometry: This i
@usametov
usametov / aider-vs-openhands.md
Created July 2, 2025 14:45
aider vs openhands

Both Aider and OpenHands are powerful open-source AI coding agents designed to assist developers, but they cater to slightly different workflows and preferences. Below is a detailed comparison of their pros and cons based on available information and community feedback, focusing on their features, usability, and performance as of July 2025.


Aider

Aider is a command-line-based AI coding assistant that enables pair programming with large language models (LLMs) to edit code in your local Git repository. It is designed for simplicity, speed, and integration with existing codebases.

Pros

  1. Ease of Setup and Use:
@usametov
usametov / transformers-http-server.md
Created June 30, 2025 18:07
run transformers with http server

https://grok.com/share/bGVnYWN5_b34d4dfb-2047-4266-87c7-12cb79e37f4a

The Hugging Face Transformers library now includes a built-in HTTP server, introduced via pull request #38443, enabling users to serve machine learning models over HTTP for inference tasks. Below is a concise tutorial on how to install and run the HTTP server, along with details on hardware requirements based on available information and general knowledge about running transformer models.


Tutorial: Installing and Running the Transformers HTTP Server

The HTTP server in the Transformers library allows you to serve models for inference via HTTP endpoints, making it easier to integrate models into applications. The following steps guide you through setting up and running the server.

@usametov
usametov / az-middleware.md
Last active July 4, 2025 13:35
azure functions middleware best practices

Implementing a middleware design pattern in Azure Functions, similar to Clojure's Ring middleware, Pedestal interceptors, or Django's middleware, is a common approach to handle cross-cutting concerns like authentication, logging, input validation, and error handling in a clean and modular way. While Azure Functions doesn't have a built-in middleware framework as robust as Ring or Django, you can implement middleware-like patterns using a combination of Azure Functions features and custom code. Below, I'll outline industry best practices for implementing middleware patterns in Azure Functions, drawing parallels to the Clojure and Django approaches, and referencing available resources.


Understanding Middleware Patterns in Context

  • Clojure Ring Middleware: In Ring, middleware is a higher-order function that wraps a handler, transforming requests before they reach the handler and/or responses after the handler processes them. Middleware is composed functionally, allowing sequential processing with
@usametov
usametov / Client-Discovery-Prompt-Draft.md
Last active June 4, 2025 02:32
growth marketing bot

You are growth consultant. Your goal is to uncover clear objectives and points of interest for [Company Name], a [Type of Business]. Use open-ended, curious questions to explore goals, challenges, and perceptions, focus on the 'why' behind motivations and needs, align with strategic aims, and engage diverse stakeholders (e.g., leadership, employees, customers). Actively listen and probe for deeper insights, using the critical incident technique to recall specific moments of success or challenge.

Step 1: Ask questions to describe Company's Line of Business and Strategic Context. This is needed to output summary.

Example questions:

How does [Company Name]’s mission or vision as a [Type of Business] guide your current priorities and strategies? Why is this alignment critical to your long-term success? Probe: Can you think of a time when this mission drove a key decision or strategy? What was the outcome?

@usametov
usametov / Rosebud-game-templates.md
Last active May 19, 2025 20:29
market research with dynamic canvas generation and gamified survey delivery

Rosebud AI Game Templates for Market Research Surveys

Rosebud AI is a generative AI platform that enables users to create 2D and 3D games and interactive experiences through natural language prompts, requiring little to no coding expertise. Its game templates provide pre-built frameworks that can be customized, making it an innovative tool for crafting dynamic canvas generation and gamified survey delivery in market research. Below, I explore how Rosebud AI’s game templates can be leveraged for market research, focusing on their features, customization options, integration with conversational AI, and practical applications, while incorporating insights from web sources.

Overview of Rosebud AI Game Templates

Rosebud AI offers a variety of templates designed to streamline game creation, which can be adapted for market research surveys. These templates serve as starting points, a

@usametov
usametov / run_storm_wiki_gpt_with_VectorRM.py
Created May 14, 2025 03:04
run storm against local qdrant instance
"""
This STORM Wiki pipeline powered by Groq (Llama3-70B) and local Qdrant vector store with Ollama embeddings.
You need to set up the following environment variables to run this script:
- GROQ_API_KEY: Groq Cloud API key
- QDRANT_API_KEY: Qdrant API key (optional, only needed if using authenticated Qdrant)
Requirements:
1. Local Qdrant instance running (default: http://localhost:6333)
2. Ollama serving the embedding model (default: all-minilm:l6-v2)
@usametov
usametov / rmt.md
Created April 17, 2025 02:16
resting motor threshold in TMS

The resting motor threshold (RMT) in transcranial magnetic stimulation (TMS) is defined as the minimum intensity of stimulation required to elicit a motor-evoked potential (MEP) of at least 50 µV peak-to-peak amplitude in a target muscle (typically the abductor pollicis brevis for upper limb studies) in at least 50% of trials (e.g., 5 out of 10 pulses) while the muscle is at rest. RMT is expressed as a percentage of the maximum stimulator output (% MSO) and varies across individuals due to factors like skull-to-cortex distance, coil type, and neural excitability.

Below, I address your questions regarding RMT, Tesla measurements, amperage, double-cone coil use for the left cerebellar hemisphere (lobule VII/Crus I), and portable TMS devices.


1. Understanding RMT and Converting 80-90% of RMT to Tesla

RMT is not directly measured in Tesla (the unit of magnetic field strength) but as a percentage of the stimulator’s maximum output. The magnetic field strength (in Tesla) depends on the TMS device

@usametov
usametov / contextual.md
Last active April 15, 2025 23:39
how to create a dataset similar to NQ from a bunch of links assigned to one or more topics.

Integrating Contextual Retrieval into your Q&A generation process for a dataset similar to the Natural Questions (NQ) dataset can enhance the quality and relevance of the generated question and answer (Q&A) pairs. Since you already have a Clojure-based pipeline for scraping websites and producing high-quality semantic chunks, and you’re interested in using a prompt to generate Q&A pairs, incorporating Contextual Retrieval can improve how you leverage your chunks by adding contextual metadata or summaries to ensure questions are more precise and answers are more grounded in the content. This approach complements your existing setup and aligns with your prior interest in advanced retrieval techniques (e.g., RAG systems, Qdrant integration, and Contextual Retrieval vs. Late Chunking, as discussed on April 9, 2025).

Below, I’ll elaborate on how to use the output of Contextual Retrieval prompts to enhance your Q&A generation, modify the existing prompt to incorporate Contextual Retrieval outputs, and provide