Skip to content

Instantly share code, notes, and snippets.

View neosavvy's full-sized avatar
🖖
HODL

Adam Parrish neosavvy

🖖
HODL
View GitHub Profile
import instructor
import time
from langchain_community.vectorstores import FAISS
from langchain_openai import OpenAIEmbeddings
from langchain.text_splitter import TokenTextSplitter
from langchain_community.document_loaders import UnstructuredURLLoader
from openai import OpenAI
from pydantic import BaseModel
import instructor
import time
from langchain_community.vectorstores import FAISS
from langchain_openai import OpenAIEmbeddings
from langchain.text_splitter import TokenTextSplitter
from langchain_community.document_loaders import UnstructuredURLLoader
from openai import OpenAI
from pydantic import BaseModel
@neosavvy
neosavvy / gist:bacdf28b69399785599b16b0c093e70e
Created March 28, 2018 17:04
Kill all the errant EC2 Instances that have disableApiTermination set to True
import boto3
client = boto3.client('ec2', region_name='us-east-1')
ec2_regions = [region['RegionName'] for region in client.describe_regions()['Regions']]
for region in ec2_regions:
conn = boto3.resource('ec2', region_name=region)
instances = conn.instances.filter()
ids = []
@neosavvy
neosavvy / gist:b01788cf7d95086aed415c0d9b06386a
Created March 2, 2018 20:41
Example Interview Question
// ==================
// Utility code start
// ==================
var Readable = require('stream').Readable;
var util = require('util');
/**
* Stream which returns numbers in ascending sorted order.
*
## Git Workflow
We want to closely monitor what gets merged down to `master` branches and keep
our commit history as clean as possible. To accomplish this we can employ a few best
practices to ensure we don't see large numbers of useless `merge` commits and in addition
to that it will keep the ordering of our commits with priority on merged work vs local
changes.
### Basic Assumptions