Skip to content

Instantly share code, notes, and snippets.

View LuceCarter's full-sized avatar

Luce Carter LuceCarter

View GitHub Profile
@LuceCarter
LuceCarter / intro_mongodb_nodejs.md
Last active June 18, 2024 17:42
A list of useful links related to MongoDB and NodeJS
@LuceCarter
LuceCarter / uselinks.md
Created May 15, 2024 15:01
Did Einstein Drink Coffee? Building a RAG app with Semantic Kernel and MongoDB Atlas
@LuceCarter
LuceCarter / EmbeddingResponse.cs
Created April 8, 2024 10:49
Code snippets for the MongoDB Atlas Vector Search with C# and Blazor tutorial
namespace SeeSharpMovies.Models
{
public class EmbeddingResponse
{
public string @object { get; set; }
public List<Data> data { get; set; }
public string model { get; set; }
public Usage usage { get; set; }
}
@LuceCarter
LuceCarter / NewsPage.razor
Created March 5, 2024 11:53
NewsPage.razor code from the Atlas and App Services tutorial
@* The `page` attribute defines how this page can be opened. *@
@page "/news"
@* The `MongoDB` driver will be used to connect to your Atlas cluster. *@
@using MongoDB.Driver
@* `BSON` is a file format similar to JSON. MongoDB Atlas documents are BSON documents. *@
@using MongoDB.Bson
@* You need to add the `Data` folder as well. This is where the `News` class resides. *@
@using CryptoNews.Models
@using Microsoft.AspNetCore.Builder
@LuceCarter
LuceCarter / Home.razor Code
Created February 26, 2024 10:58
Atlas Full-Text Search with .NET Blazor Snippets
@code {
//...
string searchTerm;
Timer debounceTimer;
int debounceInterval = 200;
//...
@LuceCarter
LuceCarter / application.css
Last active October 19, 2023 13:39
Companion code for Ruby on Rails and Atlas Application
footer { margin-top: 100px; }
table, td, th { vertical-align: middle; border: none; }
th { border-bottom: 1px solid #DDD; }
body { margin: 0; }
.navbar {
min-height: 38px;
background-color: #ECA72C;
}
.navbar-brand {
font-size: 24px;
@LuceCarter
LuceCarter / database.js
Last active September 29, 2023 20:55
Roughly accurate BS
const { MongoClient } = require('mongodb');
let mongoClient;
let db;
let todosCollection;
export async function initDatabase() {
mongoClient = await MongoClient.connectToDatabase(process.env.MONGODB_ALTAS_URI, {appName: "findmesomethingtodo"});
if(await preFlightChecks(mongoClient)) {