Skip to content

Instantly share code, notes, and snippets.

View esshka's full-sized avatar
🏠
Working from home

Eugeny esshka

🏠
Working from home
View GitHub Profile
@esshka
esshka / coding-agent.py
Created April 3, 2025 16:27 — forked from Madhav-MKNC/coding-agent.py
All the code you need to create a powerful agent that can create and edit any file on your computer using the new text_editor tool in the Anthropic API.
import anthropic
import os
import sys
from termcolor import colored
from dotenv import load_dotenv
class ClaudeAgent:
def __init__(self, api_key=None, model="claude-3-7-sonnet-20250219", max_tokens=4000):
"""Initialize the Claude agent with API key and model."""
@esshka
esshka / README.md
Created February 9, 2025 06:10 — forked from awni/README.md
Test Time Scaling with R1-based Models and MLX LM

Test Time Scaling with MLX LM and R1-based LLMs

Install MLX LM:

pip install mlx-lm

And run:

Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output.
- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure.
- Reasoning Before Conclusions: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS!
- Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed.
- Conclusion, classifications, or results should ALWAYS appear last.
- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements.
- What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from p
@esshka
esshka / min-char-rnn.py
Created June 21, 2024 13:34 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
(ns datastructures.queue
(:refer-clojure :exclude [compare-and-set! pop])
(:import java.util.concurrent.atomic.AtomicReference))
(defn- compare-and-set! [^AtomicReference aref oldval newval]
(or (.compareAndSet aref oldval newval)
(throw (RuntimeException. ::loop))))
(defmacro with-contention
[& body]
@esshka
esshka / async_util.clj
Created March 1, 2024 23:46 — forked from echeran/async_util.clj
Utility functions for core.async 0.1.346.0-17112a-alpha to create a linear pipeline of go-routines in a Storm-esque way.
(ns your.namespace.async-util
(:require
[clojure.core.async :as a :refer [>! <! >!! <!! go chan buffer
close! thread alts! alts!! timeout]]
[clojure.core.match :as match :refer [match]]))
;;
;; core.async util fns
;;
@esshka
esshka / tensorflow-gpu-in-jupyter-lab.md
Created February 12, 2024 16:38 — forked from anirban94chakraborty/tensorflow-gpu-in-jupyter-lab.md
Install Tensorflow-GPU (for NVIDIA GPUs) for use in JupyterLab using Anaconda

Install Tensorflow-GPU (for NVIDIA GPUs) for use in JupyterLab using Anaconda

This tutorial is for computers with NVIDIA GPUs installed.

Tensorflow for GPU significantly reduces the time taken by Deep Neural Networks (like CNNs, LSTMs, etc) to complete each Epoch (compute cycle) by utilizing the CUDA cores present in the GPU for parallel processing.

The following steps are to be followed:

  1. Make sure that you have installed the latest drivers of your NVIDIA GPU for your OS.
@esshka
esshka / understanding-word-vectors.ipynb
Created January 25, 2024 01:12 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@esshka
esshka / test.js
Created July 15, 2018 14:28 — forked from tsur/test.js
serialize/deserialize es6 class
class MyChart {
constructor(){
this.foo = "foo";
return this;
}
sayFoo(){
@esshka
esshka / FlowTypedMobxInject.js
Created June 23, 2018 10:24 — forked from vonovak/FlowTypedMobxInject.js
using flowtype with @Inject from 'mobx-react'
import type File from "File";
import type FileService from "FileService";
type FileDetailProps = {
file: File
};
class FileDetail extends React.Component<FileDetailProps> {
render() {
// remove the file prop and flow will complain!