Skip to content

Instantly share code, notes, and snippets.

@carlosleonam
carlosleonam / refresh_dash.php
Last active April 20, 2024 01:39
Snippet to refresh some Dashborad with Adianti Framework ( by Claonilton Junior )
<?php
$script = new TElement('script');
$script->type = 'text/javascript';
$script->add("
$(document).ready(function(){
window.setTimeout(function(){
var results = new RegExp('[\\?&]class=([^&#]*)').exec(window.location.href);
if('".__CLASS__."' == results[1] )
__adianti_load_page('index.php?class=DashboardEmpresa&method=onReload');
@wagners049
wagners049 / reload.php
Last active April 20, 2024 01:37
Adianti Framework - Carregar datagrid somente para grupo administrador
public function onReload($param = NULL)
{
try
{
if( in_array(1, TSession::getValue('usergroupids')) == 1 )
{
// se estiver dentro do grupo admin carrega os dados.
// para incluir usuário específico substituir a condição por if(TSession::getValue('userid') == 1)
}
elseif (empty($_REQUEST['method']) || ($_REQUEST['method'] == 'onShow'))
@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