Skip to content

Instantly share code, notes, and snippets.

View kallebysantos's full-sized avatar
🚀
Instalando Baidu no servidor de prod

Kalleby Santos kallebysantos

🚀
Instalando Baidu no servidor de prod
View GitHub Profile
@kallebysantos
kallebysantos / react-native-develop-guide.md
Last active March 1, 2023 12:57
Guide for setup a react-native-cli project

React Native - Development Guide

Environment Setup:

Install NodeJs LTS:

  • winget install OpenJS.NodeJS.LTS

Install OpenJDK 11:

@kallebysantos
kallebysantos / docker-install.sh
Last active July 26, 2024 08:42
Guide for setup a Linux server in order to run containerized applications
# Server Setup
## **Setup [Docker Engine:](https://www.docker.com/)**
#### Uninstall old versions:
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get remove docker docker-engine docker.io containerd runc
#### Set up the docker apt repository:
# Add Docker's official GPG key:
@kallebysantos
kallebysantos / _elastic-stack-with-docker.md
Last active May 9, 2023 13:19
Elastic Stack with Docker

Elastic Stack with Docker - GUIDE

Starting docker containers:

In order to start the Elastic + Kibana containers you should execute the following command:

docker compose up -d

Setting up Elasticsearch:

Once the container service has started run the following command to regenerate an user password:

@kallebysantos
kallebysantos / _server-send-events.md
Last active May 22, 2023 18:37
Server Send Events with .NET

.NET Sample implementation of SSE

image

Getting started

Creating our data object

// Message.cs
@kallebysantos
kallebysantos / App.tsx
Last active November 3, 2024 21:52
Running Local AI models with FastAPI and Vercel AI SDK
import "./App.css";
import { useEffect, useState } from "react";
import { useCompletion } from "ai/react";
function App() {
const [apiResponse, setApiResponse] = useState("");
useEffect(() => {
fetch("/api/reply?value=Hello from React App!")
.then((response) => response.json())
@kallebysantos
kallebysantos / option.md
Last active January 25, 2024 09:39
Rust types implementation in CSharp
public abstract record Option<T>()
{
    internal T? Value { get; init; }

    protected Option(T Value) : this()
    {
        this.Value = Value;
    }
@kallebysantos
kallebysantos / _state-pattern-csharp.md
Created February 15, 2024 09:22
State pattern implementation in C#

pattern-matching.cs

public static class PatternMatching
{
    public static U Match<U, T1, T2>(Func<T1, U> match1, Func<T2, U> match2, T1? value1, T2? value2)
    {
        if (value1 is not null)
            return match1(value1);

        if (value2 is not null)
@kallebysantos
kallebysantos / Dockerfile
Created May 2, 2024 09:07
Supabase edge functions with custom embed model
FROM supabase/edge-runtime:v1.41.2 AS build
# Change here with the HF model name. It must be ONNX runtime compatible
ENV MODEL_NAME=Xenova/paraphrase-multilingual-MiniLM-L12-v2
# Setting up
RUN apt update && apt install curl -y
# Replacing 'gte-small' by $MODEL_NAME
WORKDIR /etc/sb_ai/models/gte-small