Skip to content

Instantly share code, notes, and snippets.

View scharf's full-sized avatar

Michael Scharf scharf

View GitHub Profile
@disler
disler / standards_for_true_ai_coding_assistants.md
Created January 21, 2024 16:30
Standards For True AI Coding Assistants

What is an AI Coding Assistant?

If the coding assistant can't run ITERATIVE CRUD on ALL of your code, it's not a True AI Coding Assistant (TACA)

Standards for TRUE AI Coding Assistants

  1. Must work on existing codebases
  2. Must have a file context mechanism
  3. Must be iteratively controllable
@ninely
ninely / main.py
Last active April 19, 2024 11:04
Langchain with fastapi stream example
"""This is an example of how to use async langchain with fastapi and return a streaming response.
The latest version of Langchain has improved its compatibility with asynchronous FastAPI,
making it easier to implement streaming functionality in your applications.
"""
import asyncio
import os
from typing import AsyncIterable, Awaitable
import uvicorn
from dotenv import load_dotenv
@aaronrogers
aaronrogers / AzureLLM.ts
Created April 3, 2023 17:14
A simple, proof-of-concept Azure LLM for [Langchain.js](https://js.langchain.com/docs/).
import { BaseLLM } from 'langchain/llms'
import { CallbackManager } from 'langchain/callbacks'
import { LLMResult } from 'langchain/schema'
import { encoding_for_model, TiktokenModel } from '@dqbd/tiktoken'
export class AzureLLM extends BaseLLM {
name = 'AzureLLM'
batchSize = 20
temperature: number
concurrency?: number
@SKempin
SKempin / Git Subtree basics.md
Last active May 6, 2024 14:55
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@chrishowes
chrishowes / gist:70d35ea122ed921c7fc8
Created October 20, 2015 22:46
List of environment variables for MeteorJS
process.env.APP_ID
process.env.APP_MONGO
process.env.AUTOUPDATE_VERSION
process.env.BIND_IP
process.env.CONSTRAINT_SOLVER_BENCHMARK
process.env.DDP_DEFAULT_CONNECTION_URL
process.env.DEPLOY_DOMAIN
process.env.DEPLOY_HOSTNAME
process.env.DISABLE_WEBSOCKETS
process.env.DISCOVERY_PORT
@circuitBurn
circuitBurn / tail_oplog.py
Last active August 7, 2023 13:22
Use pymongo 3.0 to tail MongoDB's oplog
# Adapted from the example here: https://jira.mongodb.org/browse/PYTHON-735
# to work with pymongo 3.0
import pymongo
from pymongo.cursor import CursorType
c = pymongo.MongoClient()
# Uncomment this for master/slave.
oplog = c.local.oplog['$main']
@BastinRobin
BastinRobin / Email.txt
Created March 21, 2015 06:48
Generic Email List
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com
@zmwangx
zmwangx / README.md
Last active March 14, 2022 13:02
simple Twitter image crawler based on Tweepy

To use this program, put your Twitter OAuth credentials in ~/.config/twitter/oauth.json (or customize this path in tw-init.py). oauth.json should look like

{
    "consumer_key": "...",
    "consumer_secret": "...",
    "access_token": "...",
    "access_token_secret": "..."
}

See tw-init.py -h for usage. There are several external dependencies:

@allenwb
allenwb / 0Option2ConstructorSummary.md
Last active November 4, 2023 14:39
New ES6 constructor features and semantics: Alternative 2 manual super in derived classes

New ES6 Constructor Semantics and Usage Examples

Manual super: Alternative Design where subclass constructors do not automatically call superclass constructors

This Gist presents a new design of class-based object construction in ES6 that does not require use of the two-phase @@create protocol.

One of the characteristics of this proposal is that subclass constructors must explicitly super invoke their superclass's constructor if they wish to use the base class' object allocation and initialization logic.

An alternative version of this design automatically invokes the base constructor in most situations.

@gear11
gear11 / main.py
Created December 17, 2013 14:54
Simple Python proxy server based on Flask and Requests. See: http:/python-proxy-server/gear11.com/2013/12/python-proxy-server/
"""
A simple proxy server. Usage:
http://hostname:port/p/(URL to be proxied, minus protocol)
For example:
http://localhost:8080/p/www.google.com
"""