This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run with jest | |
import knex from 'knex' | |
import knexPgUpsert from '../knexPgUpsert' | |
const db = knex({ client: 'pg' }) | |
const taps = [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |