Remenber to install &zip before
#!/bin/bash
BACKUPDIR="/backup/databases/"
DATE=`date +%s`
// 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 ) ) { | |
<?php | |
.... | |
//Adicionar um texto ao footer do form | |
$addText = new TTextDisplay(FormService::getByAndAt($object), 'gray', 10, 'i'); | |
$this->form->addFooterWidget($addText); | |
$order_fornecedor_id = new TAction(array($this, 'onReload'));
$order_fornecedor_id->setParameter('order', 'fk_fornecedor_id->nome');
$column_fk_fornecedor_id_nome->setAction($order_fornecedor_id);
#!/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" |
<?php | |
class ImportacaoXmlNFe | |
{ | |
protected $chave; | |
protected $xml; | |
protected $versao; | |
public function __construct($arquivo, $tipo = 'arquivo') | |
{ |
<?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)) { |
/** | |
* 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); |