Skip to main content

Featured

Code Syntax Highlighting in Hubspot and Blogger

As a developer myself I look for code online literally every single day. One of the worst things you can find is an ill written blog, with actual code examples of what you are looking for but with bad formatting. It is absolutely awful when you find precisely what you wanted and it's plain, unreadable and intelligible text. We all know syntax highlighting is key to understanding code, that's why every developer has their editor of choice. Light theme or dark them (#darkteam here) but always highlighting the keywords. Knowing the importance of that I wanted to provide it for my readers and it turns out Hubspot doesn't handle it very well. I looked online and found an article that seems to be outdated now. Basically there's a "code" block that is supposed to do what I want but it didn't quite work. Also, I'm assuming the array of different syntaxes it can handle is very limited. Fortunately for me and my readers I'm a developer and I can come up with...

Document information extraction using LangChain and OpenAI

Unless you've been living under a rock you must have heard about the wonders of Artificial Intelligence. Perhaps you've heard about it with different names: DALL-E, for image generation; ChatGPT, for… well, chatting with the closest thing to a human mind we have at the moment. They are both powered by Open AI, the company spearheading research in the Machine Learning and Artificial Intelligence fields. If you're a coder you have all that power at your disposal. Let us show you how to harness it using Python, the default language for these type of applications.


Set up your account in openai.com, if you haven't already. Once you have it, 


Just give me the code already

Fine. Let's get coding. First thing we're gonna do is set up our virtual environment to isolate our project and handle our own dependencies and tools.


python -m venv venv


Now activate your virtual environment.

source ./venv/bin/activate

Create a file to list the dependencies and use pip to download them.

touch requirements.txt

cat <<EOT >> a.txt
langchain
openai
pypdf
EOT
pip install -r requirements.txt



Comments

Popular Posts