Skip to content

Instantly share code, notes, and snippets.

oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\powerlevel10k_rainbow.omp.json" | Invoke-Expression
Import-Module -Name Terminal-Icons
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -PredictionSource history
@carlosleonam
carlosleonam / limit-logs-adianti.md
Last active April 20, 2024 01:28
Limitando LOGs no Adianti Framework

Limitando LOGs no Adianti framework

Os logs são muito úteis para detectar os "erros" que os usuários negam/juram que não efetuaram!

Então sempre mantenho os últimos 30 dias de log. Mas o tempo fica a critério de cada um.

Cria um script SQL "clean_log.sql" (pode ser na /home/[seu_usuario]/) com:

DELETE FROM system_sql_log
@carlosleonam
carlosleonam / .php
Created January 25, 2023 15:26 — forked from scriptdev/.php
CLASSE PARA IMPORTAÇÃO DE XML NFe
<?php
class ImportacaoXmlNFe
{
protected $chave;
protected $xml;
protected $versao;
public function __construct($arquivo, $tipo = 'arquivo')
{
@padeoe
padeoe / README_hfd.md
Last active April 20, 2024 01:25
CLI-Tool for download Huggingface models and datasets with aria2/wget+git

🤗Huggingface Model Downloader

Considering the lack of multi-threaded download support in the official huggingface-cli, and the inadequate error handling in hf_transfer, this command-line tool smartly utilizes wget or aria2 for LFS files and git clone for the rest.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
  • 🚀 Multi-threaded Download: Utilize multiple threads to speed up the download process.
  • 🚫 File Exclusion: Use --exclude or --include to skip or specify files, save time for models with duplicate formats (e.g., *.bin or *.safetensors).
  • 🔐 Auth Support: For gated models that require Huggingface login, use --hf_username and --hf_token to authenticate.
  • 🪞 Mirror Site Support: Set up with HF_ENDPOINT environment variable.
<?php
require __DIR__ . '/ticket/autoload.php'; //Nota: si renombraste la carpeta a algo diferente de "ticket" cambia el nombre en esta línea
use Mike42\Escpos\Printer;
use Mike42\Escpos\EscposImage;
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
/*
Este ejemplo imprime un hola mundo en una impresora de tickets
@carlosleonam
carlosleonam / .php
Created April 22, 2023 11:26 — forked from cupertinobr/.php
Add texto no footer - addFooterWidget
<?php
....
//Adicionar um texto ao footer do form
$addText = new TTextDisplay(FormService::getByAndAt($object), 'gray', 10, 'i');
$this->form->addFooterWidget($addText);
@aleduca
aleduca / powershell.txt
Last active April 20, 2024 01:22
Powershell - oh my posh
- Baixar o powershell: https://learn.microsoft.com/pt-br/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#winget
- NerdFont: https://www.nerdfonts.com/font-downloads
- Oh My Posh: https://ohmyposh.dev/
- Criar arquivo de config: .$PROFILE ou code $PROFILE
- Instalar PSReadline: Install-Module PSReadLine -AllowPrerelease -Force
- Instalar icones: Import-Module -Name Terminal-Icons
- Apelido para comandos:
function executeArtisanCli {
php artisan $args
}
@carlosleonam
carlosleonam / fn_remove_accents.sql
Created May 27, 2023 02:02 — forked from jgdoncel/fn_remove_accents.sql
MySQL Function to remove accents and special characters
DROP FUNCTION IF EXISTS fn_remove_accents;
DELIMITER |
CREATE FUNCTION fn_remove_accents( textvalue VARCHAR(10000) ) RETURNS VARCHAR(10000)
BEGIN
SET @textvalue = textvalue COLLATE utf8_general_ci;;
-- ACCENTS
SET @withaccents = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒ';
@carlosleonam
carlosleonam / adianti-framework-order-datagrid-column-by-relation-field.md
Created April 13, 2024 16:24
Adianti Framework - TDATAGRID - Ordenação de Coluna por Campo Relacionado

TDATAGRID - Ordenação de Coluna por Campo Relacionado

No criação do Datagrid adicionar:

$order_fk_FOR_CODIGO_FOR_NOME = new TAction(array($this, 'onReload'));
$order_fk_FOR_CODIGO_FOR_NOME->setParameter('order', 'fk_FOR_CODIGO->FOR_NOME');
$column_fk_FOR_CODIGO_FOR_NOME->setAction($order_FOR_CODIGO);

Na onReload() abaixo de:

@MazeW
MazeW / nanodisplaytest.md
Last active April 20, 2024 01:20
Connecting an IPS TFT display (ST7789) to an arduino nano and testing image output.

Guide on connecting a ST7789 display to an Arduino Nano.

I recently decided to order an arduino nano and a tft display from AliExpress. When I looked up online it took me some time to find a clear guide how to connect the display to the arduino, either the display had different pins or it was a slightly different model, but with some trial and error, I managed to get it to work.

What you'll need for this:

  • 1x Arduino Nano
  • 1x AdaFruit 1.3" 240x240 ST7789 display
  • 6x jumper wires or whatever else you can use to connect

Connecting display to the arduino