Skip to content

Instantly share code, notes, and snippets.

@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 / 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 "

KoolReport Print Columns Aligh

Only affects when use print option or Ctrl+P

<style>
    @media print{
       .noprint{
           display:none;
       }

KoolReport - Disable Header Ordering

For Datagrid/Datatables package

Add below option in your report.

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

 "options"=&gt;array(

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();

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:

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

# shortform git commands
alias g='git'
# show contents of all git objects in a git repo
find .git/objects/ -type f \| sed 's/\.git\/objects\/\///' | sed 's/\///g' | xargs -n1 -I% echo echo "%" \$\(git cat-file -p "%"\) \0 | xargs -n1 -0 sh -c
# push all branches to all remotes
git remote | xargs -L1 git push --all
# count lines of .js code in a repo