Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
ls -lad .* | grep -v "^d"
# source: https://linuxhandbook.com/display-only-hidden-files/#:~:text=To%20display%20only%20the%20hidden,%5E%20means%20%27start%20with%27.
@carlosleonam
carlosleonam / adianti-framework-order-datagrid-column-by-relation-field.md
Created April 13, 2024 16:24
Adianti Framework - TDATAGRID - Ordenação de Coluna por Campo Relacionado

TDATAGRID - Ordenação de Coluna por Campo Relacionado

No criação do Datagrid adicionar:

$order_fk_FOR_CODIGO_FOR_NOME = new TAction(array($this, 'onReload'));
$order_fk_FOR_CODIGO_FOR_NOME->setParameter('order', 'fk_FOR_CODIGO->FOR_NOME');
$column_fk_FOR_CODIGO_FOR_NOME->setAction($order_FOR_CODIGO);

Na onReload() abaixo de:

@carlosleonam
carlosleonam / select2-change-style.js
Last active March 21, 2024 20:27
Adianti Framework - Builder - select2 change style
// Source: https://www.codeproject.com/Articles/1034447/Apply-CSS-Important-In-JQuery-And-CSS
$('[class="select2-disable"]').each(function () {
this.style.setProperty('opacity', '0.5', 'important');
});
@carlosleonam
carlosleonam / wp-demo-snippet-latest.php
Created December 2, 2023 01:21 — forked from gridphp/wp-demo-snippet-latest.php
Wordpress Grid 4 PHP Framework Integration - Sample Snippet, https://www.gridphp.com
/**
* Grid 4 PHP Framework
*
* @author Abu Ghufran <gridphp@gmail.com> - https://www.gridphp.com
* @version 2
* @date 20-Oct-2020
* @license: see license.txt included in package
*/
/*
@carlosleonam
carlosleonam / adianti-framwork-permission-linux-deploy.md
Last active August 19, 2023 12:22
Adianti Framwork - Permission on Linux Deploy

Adianti Framwork - Permissions on Linux Deploy

Permissão de escrita nos diretórios da aplicação:

Write permission on application directories

Permissão nos arquivos e diretórios 775, deve ser executada em todos os arquivos do projeto.

Permission on 775 files and directories, must be set on all project files

cd /var/www/html/project/
@carlosleonam
carlosleonam / vscode-resize-current-window-manually.md
Last active August 12, 2023 13:49
VSCODE - Resize Current Window Manually
@carlosleonam
carlosleonam / docker-cron-install.md
Last active August 12, 2023 12:40
Docker - CRON - Install in running container or Dockerfile

Docker - CRON - Install in running container or Dockerfile

Running Container

apt update -y
apt install -y cron
service cron start
service cron status
@carlosleonam
carlosleonam / disable_a_tag.md
Last active July 11, 2023 17:48
Disable \<a>\</a> Tag Anchor

Disable <a></a> Tag Anchor

$(document).ready(function() {
    $('a')
    .css('cursor', 'default')
    .css('text-decoration', 'none');

    $('a').on("click", function(e) {
 e.preventDefault();
@carlosleonam
carlosleonam / fn_remove_accents.sql
Created May 27, 2023 02:02 — forked from jgdoncel/fn_remove_accents.sql
MySQL Function to remove accents and special characters
DROP FUNCTION IF EXISTS fn_remove_accents;
DELIMITER |
CREATE FUNCTION fn_remove_accents( textvalue VARCHAR(10000) ) RETURNS VARCHAR(10000)
BEGIN
SET @textvalue = textvalue COLLATE utf8_general_ci;;
-- ACCENTS
SET @withaccents = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒ';
@carlosleonam
carlosleonam / 7zip-7z-to-backup-mysql-mariadb-databases.md
Last active April 26, 2023 21:40
7zip (7z) to Backup MySQL/MariaDB Databases

7zip (7z) to Backup MySQL/MariaDB Databases

Remenber to install &zip before

Create a simple shell script

#!/bin/bash

BACKUPDIR="/backup/databases/"
DATE=`date +%s`