Skip to content

Instantly share code, notes, and snippets.

View pedroduartecosta's full-sized avatar
🏠
Working from home

Pedro Costa pedroduartecosta

🏠
Working from home
View GitHub Profile
//event that triggers oracle outside of the blockchain
 event NewRequest (
uint id,
string urlToQuery,
string attributeToFetch
 );
//called by the oracle to record its answer
function updateRequest (
uint _id,
string memory _valueRetrieved
) public {
Request storage currRequest = requests[_id];
//check if oracle is in the list of trusted oracles
//and if the oracle hasn't voted yet
//triggered when there's a consensus on the final result
event UpdatedRequest (
uint id,
string urlToQuery,
string attributeToFetch,
string agreedValue
);
@pedroduartecosta
pedroduartecosta / how-i-code-with-ai.md
Last active February 11, 2025 13:04
How I Code with AI: A Practical Guide

How I Code with AI: A Practical Guide

Over the past three years, I've integrated AI tools into almost every aspect of my development workflow. From migrating legacy bash scripts to TypeScript CLIs, building Next.js applications, writing backend and frontend TypeScript code, creating Helm charts, managing infrastructure with Terraform, to debugging code across multiple languages - AI has become an essential part of how I work. I've used it for everything from improving complex SQL queries to writing Python scripts, and even for non-coding tasks like drafting postmortems and technical reviews. Here's what I've learned along the way about making AI tools truly useful in real-world development.

The Foundation: Choose the Right Tools

I primarily use two AI tools for coding:

  1. Claude Pro: My main tool for complex coding tasks and project work. While there are many AI coding assistants available, I've found Claude to be the most reliable and capable of understanding complex contexts without veering of