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
179
results
Andrew Fletcher
•
To determine the size of a directory using the terminal, you can use the du (disk usage) command. The syntax for this command can vary slightly depending on the operating system you are using, but a common way to use it is as follows:
For Linux and macOS
du -sh /path/to/directory
du
Disk usage
-s
Summarise the total size of the directory and do not include the size of each individual file within the directory
-h
Human-readable format, making the size easier to understand (e.g.,...
Andrew Fletcher
•
Having updated Solr, re-indexing wasn't working. The error in the logs...
Andrew Fletcher
•
Have you had the situation where you needed to compare the files recorded in the...
Andrew Fletcher
•
These steps are for Drupal 8 and 9.
Export your database
Order here is...
Andrew Fletcher
•
When reloading a page, you may encounter the following error:
Fatal error:...
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 issue of over 300 simultaneous database connections in the context of AWS...
Andrew Fletcher
•
Finalising a deployment to Drupal 10 and reviewing the latest log...
Andrew Fletcher
•
The error message "Attempting to re-run cron while it is already running" in...
Andrew Fletcher
•
Lando is a development environment tool that makes it easier to set up and...
Andrew Fletcher
•
In Drupal Twig templates, you can set a variable like paragraph_parent to the parent entity of a paragraph using the paragraph.getParentEntity() method. This is a common approach when you want to access the parent entity (e.g., a node) that contains the paragraph. Here's how you can do it:
{# Get the parent entity (e.g., node) of the paragraph #}
{% set paragraph_parent = paragraph.getParentEntity() %}
{# Now you can access properties of the parent entity #}
{{ paragraph_parent.title.value...
Andrew Fletcher
•
In the Drupal Status report, I'm seeing the following message
Not set
This...
Andrew Fletcher
•
Create a Lando setup running Drupal 10.
The command you provided appears to be a...
Andrew Fletcher
•
In Drupal, the Watchdog module (or the logging system) is responsible for...
Andrew Fletcher
•
Update Drupal to 10.1.x and I'm receiving the following...