This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
// Função para remover comentários do tipo //, respeitando literais de string. | |
function removeComments(jsonString) { | |
let result = ''; | |
let insideString = false; | |
let insideComment = false; | |
for (let i = 0; i < jsonString.length; i++) { | |
let char = jsonString[i]; | |
let nextChar = jsonString[i + 1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"disciplina": "Direito Constitucional", | |
"enunciado": "Qual princípio constitucional está relacionado à proibição do retrocesso social?", | |
"alternativas": { | |
"a": "Princípio da razoabilidade", | |
"b": "Princípio da dignidade da pessoa humana", | |
"c": "Princípio da vedação ao retrocesso", | |
"d": "Princípio da eficiência" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
const masterArray = []; | |
// Função auxiliar que remove linhas com comentários (começando com "//") | |
function removeComments(str) { | |
// Remove linhas que iniciam com espaços opcionais seguidos de // | |
return str.replace(/^\s*\/\/.*$/gm, ''); | |
} | |
// Tenta fazer o parse do JSON após remover comentários |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"numero": 1, | |
"texto": "O processo civil será ordenado, disciplinado e interpretado conforme os valores e as normas fundamentais estabelecidos na Constituição da República Federativa do Brasil , observando-se as disposições deste Código." | |
}, | |
{ | |
"numero": 2, | |
"texto": "O processo começa por iniciativa da parte e se desenvolve por impulso oficial, salvo as exceções previstas em lei." | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
import re | |
import json | |
# URL da página que contém os artigos | |
url = "https://www.planalto.gov.br/ccivil_03/leis/2002/l10406compilada.htm" | |
# Headers para imitar um navegador | |
headers = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>PDF Tables to Markdown</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-BR"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>PDF to Markdown (replicando quebras do PDF)</title> | |
<!-- PDF.js via CDN --> | |
<script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@3.6.172/build/pdf.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@3.6.172/build/pdf.worker.min.js"></script> | |
<style> | |
body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Plugin, ButtonView, View, InputTextView } from 'ckeditor5'; | |
export default class Exemplo extends Plugin { | |
init() { | |
const editor = this.editor; | |
// Adiciona o botão "Exemplo" à barra de ferramentas | |
editor.ui.componentFactory.add('exemplo', locale => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setx CMAKE_ARGS "-DGGML_CUDA=on" | |
pip install -U --no-cache --force-reinstall -vvv llama-cpp-python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Menu Dinâmico</title> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"> | |
</head> | |
<body class="bg-dark text-light p-3"> |
NewerOlder