Skip to content

Instantly share code, notes, and snippets.

@carlosleonam
carlosleonam / select2-tip-01.md
Last active May 26, 2021 17:37
Tip to use with select2 extendeds components Adianti Framework using it

select2 - tip

To Use with T and TDB descendants by select2 in Adianti Framework

To change some options initialized parameters, you cade add attribute to input with CamelCase to dash convertion.

Ex: maximumLenghtTag = 3 -> data-maximum-length-tag = 3

@carlosleonam
carlosleonam / Composer vendor folder content not up to repo.md
Last active May 26, 2021 21:02
Composer vendor folder content not up to repo

Composer - tip

Composer vendor folder content not up to repo

Original

Composer Tip

Should I commit the dependencies in my vendor directory?

The general recommendation is no. The vendor directory (or wherever your dependencies are installed) should be added to .gitignore/svn:ignore/etc.

@carlosleonam
carlosleonam / remove_accents.md
Last active May 29, 2021 14:09
Remover acentos de inputs (com ou sem conversão para "uppercase".

Remover acentos

Remover acentos, converter para maíuscula e converter aspas duplas para simples

function retiraAcentoTexto(palavra) {

    palavra_limpa = palavra.replace(/\u00a0/g, ' ' );

 com_acento = 'áàãâäéèêëíìîïóòõôöúùûüçÁÀÃÂÄÉÈÊËÍÌÎÏÓÒÕÖÔÚÙÛÜÇ"';

Create Maintenance Mode in Adianti Template

Original:

Coming Soon 15

Copy all files into the '/maintenance' subfolder or whatever you like (this simplifies the use of .htaccess)

Copy actual .htaccess to .htaccess-ON

Create new .htaccess-OFF with the follow contents:

Adianti - Implement conditional OR on 'onReload' after List searches

In Test

            if($filters = TSession::getValue(__CLASS__.'_filters'))
            {
                foreach ($filters as $filter)
                {
                    $filter_sql = $filter->dump();

KoolReport - Disable Header Ordering

For Datagrid/Datatables package

Add below option in your report.

Widget::create(DataTables::class,array(

 "options"=>array(

KoolReport Print Columns Aligh

Only affects when use print option or Ctrl+P

<style>
    @media print{
       .noprint{
           display:none;
       }
@carlosleonam
carlosleonam / merge_html_files.md
Last active February 17, 2024 01:49
Merge HTML files into ONE only.

Merge HTML files into ONE only

This method is similar "brute force". Pay attention when using it.

grep -iv "</body>" downloads/html/site/page1.html | grep -iv "</html>" | grep -iv "</HTML>" | grep -iv "</BODY>" > downloads/html/site/all.html
grep -iv "</body>" downloads/html/site/page2.html | grep -iv "</html>" | grep -iv "</HTML>" | grep -iv "</BODY>" >> downloads/html/site/all.html
grep -iv "</body>" downloads/html/site/page3.html | grep -iv "</html>" | grep -iv "</HTML>" | grep -iv "</BODY>" >> downloads/html/site/all.html
#..repeat as long as neccessary..
echo "
@carlosleonam
carlosleonam / php_tip_modules_loaded.md
Last active June 21, 2021 19:49
PHP - command line - show extensions loaded

PHP - command line - show extensions loaded

Using any of bwlow methods:

Simple list:

php -r "print_r(get_loaded_extensions());"

or, for detail list:

@carlosleonam
carlosleonam / calling_loading.md
Last active June 25, 2021 20:44
Chamado a tela "Carregando..." (by Whatsapp Adianti Group)

Adianti Framework - Chamando o "Carregando..." (loading)

// Chamando o aviso
$script = new TElement('script');
$script->type = 'text/javascript';
$script->add('$.blockUI({ message: "", fadeIn: 0, fadeOut: 0, css: { border: "none", top: "100px", left: 0, maxWidth: "300px", width: "inherit", padding: "15px", backgroundColor: "#000", "border-radius": "5px 5px 5px 5px", opacity: .5, color: "#fff" } });');
parent::add($script);