Skip to content

Instantly share code, notes, and snippets.

@celsowm
celsowm / index.htm
Last active June 7, 2025 15:03
Editor Markdown WYSWYG
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Editor Markdown Avançado</title>
<!-- CSS Essencial do Editor (para ser distribuído com o editor) -->
<style id="editor-core-styles">
@celsowm
celsowm / index.htm
Last active June 4, 2025 02:54
SimpleCanvasLLM
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<title>SimpleCanvasLLM with History - Chat Style</title>
<link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor.min.css" />
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
html,
@celsowm
celsowm / stream_mode_artefato.js
Created June 1, 2025 23:58
stream_mode_artefato.js
(async function() {
// 1) URL do seu servidor
const ENDPOINT = "http://localhost:8081/v1/chat/completions";
// 2) Nome exato do modelo (case‐sensitive)
const MODEL = "seu-modelo-aqui";
// 3) Texto que o usuário pediu
const PROMPT_DO_USUARIO = "escreva uma redação sobre a vida";
@celsowm
celsowm / stream_mode_json_chat_completion.js
Created June 1, 2025 23:54
stream_mode_json_chat_completion.js
(async () => {
// 1) Ajuste para o URL do seu servidor
const ENDPOINT = "http://localhost:8081/v1/chat/completions";
// 2) Use exatamente o mesmo nome de modelo que funcionou no Python
const MODEL = "seu-modelo-aqui";
// 3) Prompt de teste (igual ao Python: "Who won the world series in 2020")
const PROMPT = "Who won the world series in 2020";
@celsowm
celsowm / index.htm
Last active May 24, 2025 20:13
OPEN EXCELLM
<!DOCTYPE html>
<html lang="pt-BR" data-bs-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Leitor & Editor de Planilhas XLSX + AI</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
@celsowm
celsowm / start_llama_cpp_server.bat
Last active May 14, 2025 01:03
start_llama_cpp_server.bat
@echo off
REM ==========================================================
REM start_llama_server.bat – Escolhe modelo .gguf por número
REM + opção mmproj/offload
REM ==========================================================
setlocal EnableDelayedExpansion
cd /d "%~dp0"
echo.
echo ==========================================================
@celsowm
celsowm / index.htm
Created May 5, 2025 02:03
auto complete metionsjs com lazy load
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Autocomplete @mentions com Lazy-Load</title>
<!-- CSS do Tribute.js -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/tributejs/5.1.3/tribute.css"
@celsowm
celsowm / index.htm
Created May 5, 2025 01:52
tributejs example
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Exemplo Tribute.js Autocomplete @mentions</title>
<!-- Tribute.js CSS -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/tributejs/5.1.3/tribute.css"
@celsowm
celsowm / plugin.js
Created May 5, 2025 01:42
ballon prompt plugin
import { Plugin, ButtonView, ContextualBalloon, clickOutsideHandler, View } from 'ckeditor5';
export class HelloWorldView extends View {
constructor( locale ) {
super( locale );
// Cria o template com textarea e botão
this.setTemplate( {
tag: 'div',
attributes: {
@celsowm
celsowm / error.txt
Created May 3, 2025 02:30
error sglang
[2025-05-02 23:30:03] INFO: 127.0.0.1:52812 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
[2025-05-02 23:30:03] ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/celso/.local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 409, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/celso/.local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/celso/.local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__