Skip to content

Instantly share code, notes, and snippets.

@scriptdev
scriptdev / .php
Last active April 19, 2024 03:15
AdiantiPDFDesigner
<?php
/**
* FPDF Adapter that parses XML files from Adianti Framework
*
* @version 7.3
* @package pdfdesigner
* @author Pablo Dall'Oglio
* @copyright Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
* @license http://www.adianti.com.br/framework-license
* @alias TPDFDesigner
@scriptdev
scriptdev / .php
Created May 9, 2023 19:02
ATUALIZAR TEXTO DA SITUAÇÃO DO REGISTRO NO DATAGRID
<?php
$key = $param['key'];
$value = 'FINALIZADO';
$label = "<label><span class='badge badge-success'>{$value}</span></label>";
TScript::create("$('#row_{$key} td:nth-child(6)').html(`{$label}`)");
# AGRADECIMENTO: CLEITON SOUSA
@scriptdev
scriptdev / .php
Last active April 19, 2024 03:14
SALVA A UNIDADE NO MODO INCLUSÃO
<?php
public function onSave($param = null)
{
try
{
TTransaction::open(self::$database);
$object = new Venda();
@scriptdev
scriptdev / .php
Created May 12, 2023 13:51
ALTERAR COR DO BOTÃO VIA jQUERY
<?php
TScript::create('
$("#btn_salvar").css({
"background-color": "#FFFFFF",
"color": "#555555"
});
');
@scriptdev
scriptdev / .php
Created May 19, 2023 13:21
ADICIONAR INTERVALO DE 20 MINUTOS ( AGENDA )
<?php
$data_final = new DateTime($data->data_inicial);
$data_final->add(new DateInterval('PT20M'));
$data->$data_final = $data_final->format('Y-m-d H:i:s');
@scriptdev
scriptdev / .php
Created May 19, 2023 16:44
ALTERAR COR DO BOTÃO
<?php
TScript::create('
$("#btn_salvar").css({
"background-color": "#00304A",
"color": "#FFFFFF"
});
');
@scriptdev
scriptdev / .php
Last active April 19, 2024 03:12
DESABILITAR CAMPO ( TDBUniqueSearch e TDBCombo )
<?php
$this->form->getField('cidade_id')->setEditable(false);
TDBUniqueSearch::disableField(self::$formName, 'cidade_id');
# AGRADECIMENTO: JOYCE
@ericmjl
ericmjl / ds-project-organization.md
Last active April 19, 2024 03:12
How to organize your Python data science project

UPDATE: I have baked the ideas in this file inside a Python CLI tool called pyds-cli. Please find it here: https://github.com/ericmjl/pyds-cli

How to organize your Python data science project

Having done a number of data projects over the years, and having seen a number of them up on GitHub, I've come to see that there's a wide range in terms of how "readable" a project is. I'd like to share some practices that I have come to adopt in my projects, which I hope will bring some organization to your projects.

Disclaimer: I'm hoping nobody takes this to be "the definitive guide" to organizing a data project; rather, I hope you, the reader, find useful tips that you can adapt to your own projects.

Disclaimer 2: What I’m writing below is primarily geared towards Python language users. Some ideas may be transferable to other languages; others may not be so. Please feel free to remix whatever you see here!

@scriptdev
scriptdev / .php
Last active April 19, 2024 03:12
DEFINIR TEMPO LIMITE DE EXECUÇÃO NO PHP ( TIMEOUT )
<?php
ini_set('max_execution_time', 0); # ILIMITADO
ini_set('max_execution_time', 300); # 5 MINUTOS
set_time_limit(0); # ILIMITADO
set_time_limit(0); # 5 MINUTOS
@scriptdev
scriptdev / .php
Created May 24, 2023 01:25
MOSTRAR TOTAL DE REGISTROS NO RODAPÉ DO FILTRO DA LISTAGEM
<?php
public function onReload($param = NULL)
{
$total_registros = (int) $repository->count();
$html_registros = "<p style='font-size:16px ;display: inline-flex !important; padding-left: 15px !important'><strong>{$total_registros} </strong> &nbsp;Total de Registros</p>";
$this->form->addFooterWidget($html_registros);
}