Skip to content

Instantly share code, notes, and snippets.

@scriptdev
scriptdev / .php
Created October 23, 2023 19:37
FORMATAR VALOR NUMERICO COM PONTO
<?php
$valor = 490;
$valor_formatado = number_format($valor, 2, '.', '');
# RESULTADO: 490.00
@scriptdev
scriptdev / .php
Created October 24, 2023 04:48
DEFINIR ORDENAÇÃO PELO CAMPO DE OUTRA TABELA NO DATAGRID
<?php
public function onReload($param = NULL)
{
if (empty($param['order']))
{
$param['order'] = 'cidade->nome';
$criteria->setProperties($param);
}
@scriptdev
scriptdev / .php
Created October 26, 2023 16:50
BLOQUEAR A SELEÇÃO e COPIAR DO TEXTO
<?php
TScript::create('
$(document).ready(function() {
var elemento = $("#ID_DO_FORMULARIO");
elemento.on("copy", function(e) {
e.preventDefault();
});
elemento.css({
@kalomaze
kalomaze / local_llm_glossary.md
Last active April 19, 2024 02:35
Local LLM Glossary v2

Kalomaze's Local LLM Glossary

Not super comprehensive (yet), but I think having up to date documentation like this should be quite helpful for those out of the loop. Things change all the time in local AI circles, and it can be dizzying to catch up from an outsider's perspective, especially if you are new to the more technical aspects of language models in general (and not just locally hosted LLMs).

Available Models

Llama

  • A language model series created by Meta. Llama 1 was originally leaked in February 2023; Llama 2 then officially released later that year with openly available model weights & a permissive license. Kicked off the initial wave of open source developments that have been made when it comes to open source language modeling. The Llama series comes in four distinct sizes: 7b, 13b, 34b (only Code Llama was released for Llama 2 34b), and 70b. As of writing, the hotly anticipated Llama 3 has yet to arrive.

Mistral

  • Mistral AI is a French company that also distributes open weight
@scriptdev
scriptdev / .php
Created October 27, 2023 20:17
MOSTRAR APENAS OS USUÁRIO DO GRUPO ADMINISTRADOR "admin"
<?php
$criteria_usuario_id = new TCriteria();
$criteria_usuario_id->add(new TFilter('id', 'in', "(SELECT system_user_id FROM system_user_group WHERE system_group_id = '1')"));
$usuario_id = new TDBCombo('usuario_id', 'banco', 'SystemUsers', 'id', '{name}','name asc' , $criteria_usuario_id);
//jvascript
//id, culture, label
var c1 = new Calendar('dateStart', 'es-MX', 'Start Date');
//HTML - min & max date in mm/dd/yy format
<input type="text" id="dateStart" name="dateStart"
data-val="true"
data-val-required="required"
data-val-daterange="invalid"
@mcastelino
mcastelino / iptables-cheatsheet.md
Last active April 19, 2024 02:31
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@bjacob
bjacob / README.md
Last active April 19, 2024 02:31
IREE / MLIR / Linalg tutorial

IREE/MLIR/Linalg tutorial

Introduction

This tutorial is simultaneously about IREE, MLIR, and specifically the MLIR Linalg dialect.

What is MLIR?

MLIR is a programming language, but MLIR in itself is almost just an empty shell. What it really provides is a framework allowing to define MLIR dialects which are where the features come from.

@idleberg
idleberg / vscode-macos-context-menu.md
Last active April 19, 2024 02:28
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@scriptdev
scriptdev / .php
Last active April 19, 2024 02:27
OCULTAR COLUNA DO DATAGRID DETAILFORM
<?php
# SEM O CLASS
TScript::create("$('table th:contains(\"TITULO DA COLUNA\")').hide();");
# COM O CLASS
TScript::create("$('table th.tdatagrid_col:contains(\"TITULO DA COLUNA\")').hide();");
# "tdatagrid_col" É O NOME DO class
# "TITULO DA COLUNA" É O NOME DO TÍTULO DA COLUNA