Skip to content

Instantly share code, notes, and snippets.

@nhphong
nhphong / gitignore-handler.js
Last active July 12, 2024 00:34
Handle .gitignore file
const readGitignoreFile = async (directoryHandle) => {
try {
const fileHandle = await directoryHandle.getFileHandle('.gitignore');
const file = await fileHandle.getFile();
const content = await file.text();
return content.split('\n')
.map(line => line.trim())
.filter(line => line && !line.startsWith('#'));
} catch (error) {
return [];
@nhphong
nhphong / swagger_spec.yaml
Last active May 17, 2024 03:27
Vector DB as a Service API Spec
swagger: '2.0'
info:
title: Vector Stores and Text Management API
version: '1.0.0'
host: 'your-api.com'
schemes:
- https
basePath: /api/v1
produces:
- application/json