Skip to content

Instantly share code, notes, and snippets.

View donvito's full-sized avatar
🚀
Local AI and Agents

Melvin Vivas donvito

🚀
Local AI and Agents
View GitHub Profile
@donvito
donvito / main.go
Last active December 17, 2025 17:03
AES-256 encrypt/decrypt in Go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
)
@donvito
donvito / security-coding-practices.mdc
Created April 26, 2025 03:58
Cursor Rules for Securing your app
# Secure Coding Practices
## Input Validation
- Always validate user input on both client and server sides
- Never trust client-side validation alone
- Use validation libraries appropriate for your framework (e.g., Zod, Joi, Yup)
## Prevent SQL Injection
@donvito
donvito / docker-compose-stack-elasticsearch-fluentd-nginx-kibana.yml
Last active February 15, 2025 10:49
Docker stack compose files I've created. Please feel free to use! Enjoy!
version: "3.3"
services:
elasticsearch:
image: 'docker.elastic.co/elasticsearch/elasticsearch:5.6.1'
ports:
- "9200:9200"
- "9300:9300"
volumes:
- elasticsearchvol:/usr/share/elasticsearch/data
[
{ "title": "Pricing Component", "generationId": "rRBlufM", "author": "Steven Tey" },
{ "title": "Health Charts", "generationId": "R3W5UMZB50j", "author": "shadcn" },
{ "title": "Hero Section", "generationId": "0W13RkH", "author": "shadcn" },
{ "title": "Weather App", "generationId": "bo2N7pU", "author": "Alice Johnson" },
{ "title": "Login Screen", "generationId": "CZIY9QmU1We", "author": "Bob Brown" },
{ "title": "Login Screen", "generationId": "yK24QpZ6ECp", "author": "Charlie Davis" },
{ "title": "Course Video", "generationId": "Jg1C9YuOYKp", "author": "Diana Evans" }
]
@donvito
donvito / main.py
Last active August 15, 2024 06:13
OpenAI Structured Output Example - Study Plan Generator
from pydantic import BaseModel
from typing import List, Optional
from openai import OpenAI
import json
from pydantic import BaseModel
from typing import List, Optional
from output_generators import generate_html, generate_pdf
@donvito
donvito / api_chain_example.ipynb
Last active April 24, 2024 12:44
api_chain_one_map_api_example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@donvito
donvito / page.tsx
Created September 21, 2023 07:01
client code
'use client';
import { Textarea } from "@/components/ui/textarea"
import { Button } from "@/components/ui/button"
import { useChat } from 'ai/react';
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
import Footer from "../footer";
import { renderContent } from "../message-response/messageUtils";
//for mocking to test the UI
@donvito
donvito / query-notion-page.py
Last active August 25, 2023 14:02
llama_index examples
import logging
import sys
import openai
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
from llama_index.llms import OpenAI
from llama_index import ListIndex, NotionPageReader, ServiceContext
import os
@donvito
donvito / llama_index_public.ipynb
Created April 8, 2023 06:58
llama_index_public.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@donvito
donvito / main.go
Last active November 26, 2022 03:41
Hello World
// This is a comment
package main
import "fmt"
func main() {
fmt.Println("Hello World!")
}