Skip to content

Instantly share code, notes, and snippets.

@carlosleonam
carlosleonam / SaleMultiValueForm.php
Last active April 20, 2024 01:36
Exemplo "Form mestre-detalhe de vendas" do Adianti Tutor 7 - (com algumas correções para funcionar)
<?php
/*
* link original: https://www.adianti.com.br/framework_files/tutor/index.php?class=SaleMultiValueForm
*/
/**
* SaleForm Registration
* @author <your name here>
*/
class SaleMultiValueForm extends TPage
@filewalkwithme
filewalkwithme / main.go
Created February 7, 2015 21:50
Listening multiple ports on golang http servers
package main
import (
"net/http"
)
func main() {
finish := make(chan bool)
server8001 := http.NewServeMux()
@carlosleonam
carlosleonam / DuplicataReport.php
Last active April 20, 2024 01:32
Modelo Duplicata com TCPDF ( by Paulo Guimarães )
<?php
/**
* DuplicataReport Report
* @author <your name here>
*/
include_once('vendor/tecnickcom/tcpdf/tcpdf_include.php');
@carlosleonam
carlosleonam / page_dompdf.md
Last active April 20, 2024 01:31
Paging with DomPDF and Adianti Framework ( by Eduardo )

Paging with DomPDF and Adianti Framework ( by Eduardo )

Boa tarde Srs. Utilizo o Dompdf para gerar meus relatórios feitos em html. Para chamada do Dompdf utilizo o Seguinte padrão

// converts the HTML template into PDF
                $dompdf = new \Dompdf\Dompdf();
                $options = new \Dompdf\Options();
@vijay-prema
vijay-prema / ubuntu-on-asus-g14.md
Last active April 20, 2024 01:30
Ubuntu on Asus ROG Zephyrus G14 2021

Ubuntu on Asus ROG Zephyrus G14 2021 (Setup guide)

Here is a way to do a robust install of Ubuntu (+ optional Windows 11 dual boot and LUKS encryption) on an Asus laptop, with minimal usable hardware support, without a significant amount of tinkering that may break in future or require frequent technical attention.

In summary, the key thing is to have an up to date kernel, which usually means disabling secure-boot and installing the latest stable (6.0+) using mainline or xanmod, and as well as making sure the latest nvidia driver and dkms is installed.

Specs:

  • Model Asus G14 2021 (GA401QC)
  • AMD R7 5800 8 core 16 thread (onboard Radeon graphics)
  • NVIDIA RTX 3050 4GB (60W +15W boost)
@carlosleonam
carlosleonam / gerar_parcelas_data.php
Last active April 20, 2024 01:30
Gerar Parcelas ( by Breno )
<?php
if ($param['mes'] == '12')
{ // mes de dezembro, troca o mes para janeiro e muda para o ano seguinte
$mes_vecto = '01';
$ano_vecto = $param['ano'] + 1;
}
else
{
$mes_vecto = $param['mes'] + 1;
$ano_vecto = $param['ano'];
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.