Skip to content

Instantly share code, notes, and snippets.

@entrepeneur4lyf
entrepeneur4lyf / gist:d38d50e13cd09138fbca97316fef8ac7
Created February 28, 2025 01:43
Coding Prompt - Reward system self scoring
All code you write MUST be fully optimized.โ€œFully optimizedโ€ includes:
โ€ข Maximizing algorithmic big-O efficiency for memory and runtime (e.g., preferring O(n) over O(nยฒ) where possible, minimizing memory allocations).
โ€ข Using parallelization and vectorization where appropriate (e.g., leveraging multi-threading, GPU acceleration, or SIMD instructions when the problem scale and hardware context justify it).
โ€ข Following proper style conventions for the code language (e.g., adhering to PEP 8 for Python, camelCase or snake_case as per language norms, maximizing code reuse (DRY)).
โ€ข No extra code beyond what is absolutely necessary to solve the problem the user provides (i.e., no technical debt, no speculative features, no unused variables or functions).
โ€ข Ensuring readability and maintainability without sacrificing performance (e.g., using meaningful variable/function names, adding concise comments only where intent isnโ€™t obvious from the code).
โ€ข Prioritizing language-specific best practices and idiomatic
@tbogdala
tbogdala / kokoro_v1_0.py
Created February 13, 2025 01:37
Quick and dirty kokoro invocation that also plays the audio as well as saving it.
# 1๏ธโƒฃ Install required packages
# pip install kokoro soundfile sounddevice argparse
import sys
import argparse
from kokoro import KPipeline
import soundfile as sf
import sounddevice as sd
# ๐Ÿ‡บ๐Ÿ‡ธ 'a' => American English, ๐Ÿ‡ฌ๐Ÿ‡ง 'b' => British English
@Kelechiede
Kelechiede / Extracting_and_Visualizing_Stock_Data.ipynb
Created February 4, 2025 07:22
Analyzing Tesla and GameStop stock using yfinance and web scraping
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@netixc
netixc / main.py
Last active February 3, 2025 09:38
chatbot ollama/tts kokoro/stt speaches
import pyaudio
import wave
import time
import warnings
from openai import OpenAI
import json
import sys
import io
import numpy
import requests
@virattt
virattt / hedge-fund-agent-team-v1-3.ipynb
Last active March 28, 2025 05:53
hedge-fund-agent-team-v1-3.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@virattt
virattt / backtesting-101.ipynb
Created November 11, 2024 23:40
backtesting-101.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

๐Ÿš€ Agents with txtai

We're thrilled to share a preview version of txtai agents. Inspired by the simplicity of frameworks like OpenAI Swarm, txtai agents are built on top of the Transformers Agent framework. This supports all LLMs txtai supports (Hugging Face, llama.cpp, OpenAI + Claude + AWS Bedrock via LiteLLM).

The following example shows how to create an agent with txtai. Agents will be available in the upcoming txtai 8.0 release (available now in the txtai GitHub repo now - follow #804 - feedback welcome).

Install

@Skarlso
Skarlso / bulk-delete-packages.sh
Created October 22, 2024 07:58
Delete packages for a user using a glob
#!/bin/bash
set -e
# Variables
OWNER=$1 # Replace with your GitHub username or organization name
PACKAGE_GLOB=$2 # Glob pattern for package names passed as an argument (e.g., "package*" to match all)
# Function to delete a package version
delete_package_version() {
@alwin-augustin-dev
alwin-augustin-dev / code_review.sh
Created October 17, 2024 06:31
Automated code review using local LLMs
#!/bin/bash
# Define variables
REPO_PATH=""
PR_NUMBER=""
OLLAMA_API_URL="http://localhost:11434/api/generate"
OUTPUT_FILE="code_review_output.md"
MODEL="llama3.1:8b"
MAX_CONTEXT_LINES=20000
@rmtbb
rmtbb / ChatGPT Canvas HTML Renderer from Clipboard.url
Last active April 24, 2025 10:07
Bookmarklet that lets you render a full HTML page with any included css and javascript that is currently copied to your clipboard. Also works for SVG code. Useful with ChatGPT Canvas
javascript:(function(){try{navigator.clipboard.readText().then(function(t){if(t){var e=window.open("","_blank","width=800,height=600");e.document.open(),e.document.write(t),e.document.close()}else alert("Clipboard is empty. Please copy some text to the clipboard first.")}).catch(function(t){console.error("Failed to read clipboard contents: ",t),alert("An error occurred while trying to access the clipboard. Please ensure your browser allows clipboard access.")})}catch(t){console.error("An error occurred:",t),alert("An error occurred while trying to open the new window with the clipboard content.")}})();//bookmarklet_title: HTML Preview from Clipboard