This file contains hidden or 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
| # (...) | |
| # Custom 'ask' function to interact with the Ollama model | |
| # Usage: ask "your question here" | |
| # Code-block location: ~/.bashrc | |
| # Require Ollama with main and summary models | |
| ask() { | |
| # Configuration | |
| local MAIN_MODEL="qwen2.5-coder:3b-instruct" | |
| local SUMM_MODEL="qwen2.5:0.5b-instruct" |
This file contains hidden or 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
| // Trying to learn Rust - Simple Calculator | |
| // Tentando aprender Rust - Calculadora Simples | |
| // Define possible operations as an enum (enumeration) | |
| // Define possíveis operações com tipo enum (enumeração) | |
| enum Operation { | |
| Add, // Soma | |
| Subtract, // Subtração | |
| Multiply, // Multiplicação | |
| Divide, // Divisão |
This file contains hidden or 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
| Array.prototype.asyncForEach = async function (fn) { | |
| for (let i = 0; i < this.length; i++) { | |
| await fn(this[i], i); | |
| } | |
| }; | |
| const asyncFunc = async (txt, ms) => new Promise((resolve,_reject) => | |
| setTimeout(() => resolve(console.log(`'${txt}'\t em ${ms} ms`)), ms)); | |
| const arrayDados = ['eita', 'cara', 'que', 'coisa', 'doida']; |
This file contains hidden or 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
| -- criação e uso do db | |
| DROP DATABASE IF EXISTS copa; | |
| CREATE DATABASE copa; | |
| USE copa; | |
| -- criacao da tabela com restrições no campo | |
| CREATE TABLE grupo_c (selecoes VARCHAR(20) UNIQUE NOT NULL); | |
| -- inserção de times na tabela | |
| INSERT INTO grupo_c (selecoes) | |
| VALUES ('Brasil'), | |
| ('Turquia'), |
This file contains hidden or 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
| const interval = 250; // Em ´ms´ (valor muito baixo vai gerar lag na navegação) | |
| let SB = null; | |
| // seletor Xpath | |
| function getElementByXpath(path) { | |
| return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
| } | |
| function iniciarSB() { | |
| console.log('SponsorBlock iniciado', new Date().toLocaleString()); |