developer resources
Codebales holds an ever growing number of solutions to problems that we have experienced in our day to day code writing
Selected filter
26
results
Andrew Fletcher
•
Overview of the elements
Set Up API Keys
Obtain API keys for Pinecone and OpenAI.
Store the keys securely. Consider using a credentials.py file (as mentioned in a previous response).
Install Required Libraries
Install the necessary Python libraries, such as Pinecone's Python client (pinecone-client) and OpenAI's Python client (openai).
pip install pinecone-client openai
Create a Language Model Chain
Use OpenAI's language model (e.g., GPT-4) to understand and process...
Andrew Fletcher
•
The error message "RuntimeError: Directory 'static/' does not exist" typically...
Andrew Fletcher
•
It seems like you're using the CharacterTextSplitter class from the tiktoken...
Andrew Fletcher
•
OpenAI request timeout?
Retrying...
Andrew Fletcher
•
While the default version on Ubuntu 20.04 for Python is 3.8, I've added Python...
Andrew Fletcher
•
A summary of Node package commands
Short cut commands
npm install <package>
npm i <package>npm install --save <package>
npm i -S <package>npm install --save-dev <package>
npm i -D <package>npm install --global <package>
npm i -G <package>npm test
npm t
Update and outdated
Use outdated to discover dependencies that are out of date
npm outdatedUse update to perform safe dependency upgrades
npm updateUse install <packagename>@latest to...
Andrew Fletcher
•
Set up your server
Begin by cleaning up your server environment. Do...
Andrew Fletcher
•
Update Ubuntu 20.04
To begin update the server using the command
sudo apt update...
Andrew Fletcher
•
Goal: Restrict content access through username and password entry on an Nginx...
Andrew Fletcher
•
Installing PHP on OSX and it installed PHP 8.2.x. However, for my...
Andrew Fletcher
•
An approach to generating a backup server is using a shell script. A script can define directories to backup, and pass those directories as arguments to the tar utility, which creates an archive file. The archive file can then be moved or copied to another location.
Example Shell Script
#!/bin/bash
#
# Backup script
#
# NAME: daily-backup.sh
# PATH: /mnt/e/bin
# DESC: Backup scripts, documents and configuration files to .tar
#
# What to backup
# backup_files="/home...
Andrew Fletcher
•
Goal: Restrict content access through username and password entry.
1: Apache...
Andrew Fletcher
•
JSON structure
Outlining the structure of the elements common attributes:...
Andrew Fletcher
•
In this instance, I'll check the beginning of the string. I want to focus...
Andrew Fletcher
•
Working from the bases that .DS_Store has not been added to your git repository,...