Skip to content

Instantly share code, notes, and snippets.

@fayqLs
fayqLs / .php
Last active August 30, 2024 11:39
CLASSE PARA IMPORTAÇÃO DE XML NFe
<?php
# EXEMPLO DE USO:
$xml = new ImportarXMLNotaFiscal($arquivo_xml);
$dest = $xml->getIde();
$emit = $xml->getEmitente();
class ImportarXMLNotaFiscal
{
@brunoconstantino
brunoconstantino / .php
Created September 12, 2022 03:54
Tela para selecionar colunas em listagem
<?php
// Bruno Constantino 12-09-2022
/*
Crie uma Nova Ação no Cabeçalho;
Defina o nome da variável como "btnShowColumns";
Defina a Variável com escopo a nivel de classe como SIM;
Defina como método estático;
Defina o método como "onShowColumnsFilters";
Copie os trechos de código abaixo em seus respectivos locais definidos no Adianti Builder;
@fayqLs
fayqLs / .php
Last active January 7, 2023 09:19
MÁSCARA DINÂMICA AO DIGITAR DO TELEFONE e CELULAR NO TEntry
<?php
## ADICIONAR ANTES DO parent::add($container);##########################
TScript::create(
"$(document).on('keydown', 'input[name=\'celular\']', function (e) {
var digit = e.key.replace(/\D/g, '');
var value = $(this).val().replace(/\D/g, '');
var size = value.concat(digit).length;
$(this).mask((size <= 10) ? '(00) 0000-0000' : '(00) 00000-0000');
@megahirt
megahirt / Docker with XDebug.md
Last active March 28, 2025 09:03
Debugging PHP with XDebug v3 inside Docker using VSCode

Debugging PHP with XDebug v3 inside Docker using VSCode

Assumptions / Prerequisites

  • XDebug v3+ inside Docker (e.g. php:7.3-apache Docker image)
  • Running Docker v20.10+
  • VSCode with PHP Debug Extension (Felix Becker)
  • Using Docker Compose for orchestration

Objective

version: '3.7'
# Networks
networks:
# Internal network
internal:
driver: bridge
# Volumes
volumes:
@renatofrota
renatofrota / Navegacao.php
Last active December 15, 2023 20:20
Classe de Navegação para Adianti Framework
<?php
/**
* Classe de Navegação para Adianti Framework
*
* Guarda e recupera parametros relacionados (order, offset, limit, direction, page, first_page)
* para manter o estado da paginação dos datagrids ao navegar pelas classes e janelas do sistema
*
* @author Renato Frota <[email protected]>
*/
@gridphp
gridphp / wp-demo-snippet-latest.php
Last active January 27, 2025 06:54
Wordpress Grid 4 PHP Framework Integration - Sample Snippet tested with Wordpress 6.4.3, https://www.gridphp.com
/**
* Grid 4 PHP Framework
*
* @author Abu Ghufran <[email protected]> - https://www.gridphp.com
* @version 3
* @date 09-Aug-2024
* @license: see license.txt included in package
*/
/*
DROP FUNCTION IF EXISTS proper;
SET GLOBAL log_bin_trust_function_creators=TRUE;
DELIMITER |
CREATE FUNCTION proper( str VARCHAR(128) )
RETURNS VARCHAR(128)
BEGIN
DECLARE c CHAR(1);
DECLARE s VARCHAR(128);
DECLARE i INT DEFAULT 1;
DECLARE bool INT DEFAULT 1;
@bougui505
bougui505 / autogit.sh
Last active February 20, 2023 16:56
#!/usr/bin/env zsh
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- [email protected]
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2017-08-25 14:59:30 (UTC+0200)
usage ()
{
echo "Usage"
@jgdoncel
jgdoncel / fn_remove_accents.sql
Last active March 19, 2025 13:06
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 = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒ';