Discover gists
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 ArrayForm extends TPage | |
{ | |
protected $form; | |
private $formFields = []; | |
private static $formName = 'form_ArrayForm'; | |
private static $array = array(); # DECLARAÇÃO DA ARRAY |
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
DOWNLOAD (GOOGLE DRIVE) | |
https://drive.google.com/file/d/1RCbBzfrXLOWg00donTCQAHWbYR3RGp3r/view?usp=share_link | |
LINK DIRETO | |
https://sourceforge.net/projects/adianti/files/Adianti%20Studio/studio-7.0.0.exe/download | |
LINK (SITE OFICIAL) | |
https://www.adianti.com.br/studio-windows |
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 | |
$com_zeros = '083986556461'; | |
$sem_zeros = ltrim($com_zeros, '0'); | |
echo $sem_zeros; # RETORNO: 83986556461 |
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
locales={}; | |
--- Structure: | |
--- [module]={ [exp]="x", [exp2]="y" } | |
local lang=Config.Language; | |
local function explode(input, separator) | |
if input:len() == 0 then return {} end | |
if input:len() == 1 then return { input } end | |
separator = type(separator) == "string" and separator:sub(1, 1) or tostring(separator) |
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 | |
echo floor(5.3); # RETORNO 6 |
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 | |
$estado_id = new TDBCombo('estado_id', 'bd_condominio', 'Estado', 'id', '{descricao}','descricao asc'); | |
$btn_adicionar_cidade = new TButton('btn_adicionar_cidade'); | |
$btn_adicionar_cidade->setImage('fas:plus-circle #000000'); | |
$btn_adicionar_cidade->addStyleClass('btn-default'); | |
# CAPTURA O ID DO ESTADO E ENVIA POR PARÂMETRO NA AÇÃO | |
$btn_adicionar_cidade->setAction(new TAction(['CadastroCidadeForm', 'onShow'],['estado_id' => 'estado_id']),""); |
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 | |
public static function onFormatarTelefone($numero) | |
{ | |
$numero = ltrim($numero, '0'); # remove o zero a esquerda | |
$tamanho = strlen(preg_replace("/[^0-9]/", "", $numero)); # calcula o tamanho | |
if ($tamanho == 10) | |
{ |
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 | |
$cep = '58.458-500'; | |
$cep = str_replace(['-','.'], ['', ''], $cep); | |
echo $cep; | |
# RESULTADO: 58458500 |
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
#!/bin/bash | |
# Author: Casper Pedersen (github.com/casperghst42) | |
# License: GPL2 | |
wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2 | |
virt-customize -a debian-12-generic-amd64.qcow2 --install qemu-guest-agent --install resolvconf --install systemd-resolved --update --run-command 'mkdir -p /etc/network/interfaces.d' --run-command 'echo "auto ens18" >> /etc/network/interfaces.d/ens18' --run-command 'echo "iface ens18 inet manual" >> /etc/network/interfaces.d/ens18' | |
qm create 100000 --name "debian12-cloudinit-template" --memory 2048 --net0 virtio,bridge=vmbr0 | |
qm importdisk 100000 debian-12-generic-amd64.qcow2 local-lvm -format qcow2 |
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 | |
# EXEMPLO DE USO: | |
$xml = new ImportarXMLNotaFiscal($arquivo_xml); | |
$dest = $xml->getIde(); | |
$emit = $xml->getEmitente(); | |
class ImportarXMLNotaFiscal | |
{ |
NewerOlder