Skip to content

Instantly share code, notes, and snippets.

View Whoaa512's full-sized avatar
❤️
Love

C.J. Winslow Whoaa512

❤️
Love
View GitHub Profile
@Whoaa512
Whoaa512 / chatgpt.py
Created March 11, 2023 03:31 — forked from joeddav/chatgpt.py
Simple ChatGPT
import openai
class ChatGPT:
""" A very simple wrapper around OpenAI's ChatGPT API. Makes it easy to create custom messages & chat. """
def __init__(self, model="gpt-3.5-turbo", completion_hparams=None):
self.model = model
self.completion_hparams = completion_hparams or {}
self.history = []
self._messages = []
@Whoaa512
Whoaa512 / test.js
Last active August 17, 2017 23:57 — forked from adnanoner/upsert.js
Knex postgres upsert
// Run with jest
import knex from 'knex'
import knexPgUpsert from '../knexPgUpsert'
const db = knex({ client: 'pg' })
const taps = [
{
My thoughts on writing tiny reusable modules that each do just one
thing. These notes were adapted from an email I recently sent.
***
If some component is reusable enough to be a module then the
maintenance gains are really worth the overhead of making a new
project with separate tests and docs. Splitting out a reusable
component might take 5 or 10 minutes to set up all the package
overhead but it's much easier to test and document a piece that is
#!/usr/bin/env bash
# Setup script for hacking chrome devtools
# Source -> https://medium.com/p/8c8896f5cef3
echo "Creating folder and initialize a git repo"
mkdir devtools-frontend && cd devtools-frontend
git init
echo "Adding chromium remote and initialize sparse checkout"
git remote add upstream https://chromium.googlesource.com/chromium/blink