This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 | |
*/ | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode 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 = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒ'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if we are in a local environment | |
function is_localhost() { | |
// set the array for testing the local environment | |
$whitelist = array( '127.0.0.1', '::1' ); | |
// check if the server is in the array | |
if ( in_array( $_SERVER['REMOTE_ADDR'], $whitelist ) ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
.... | |
//Adicionar um texto ao footer do form | |
$addText = new TTextDisplay(FormService::getByAndAt($object), 'gray', 10, 'i'); | |
$this->form->addFooterWidget($addText); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# -*- coding: UTF8 -*- | |
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr | |
# https://research.pasteur.fr/en/member/guillaume-bouvier/ | |
# 2017-08-25 14:59:30 (UTC+0200) | |
usage () | |
{ | |
echo "Usage" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ImportacaoXmlNFe | |
{ | |
protected $chave; | |
protected $xml; | |
protected $versao; | |
public function __construct($arquivo, $tipo = 'arquivo') | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_ip_address() { | |
$ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'); | |
foreach ($ip_keys as $key) { | |
if (array_key_exists($key, $_SERVER) === true) { | |
foreach (explode(',', $_SERVER[$key]) as $ip) { | |
// trim for safety measures | |
$ip = trim($ip); | |
// attempt to validate IP | |
if (validate_ip($ip)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns an string clean of UTF8 characters. It will convert them to a similar ASCII character | |
* www.unexpectedit.com | |
*/ | |
function cleanString($text) { | |
// 1) convert á ô => a o | |
$text = preg_replace("/[áàâãªä]/u","a",$text); | |
$text = preg_replace("/[ÁÀÂÃÄ]/u","A",$text); | |
$text = preg_replace("/[ÍÌÎÏ]/u","I",$text); | |
$text = preg_replace("/[íìîï]/u","i",$text); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
# Networks | |
networks: | |
# Internal network | |
internal: | |
driver: bridge | |
# Volumes | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
NewerOlder