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 | |
// COM true, IRÁ SALVAR SEM A MÁSCARA DO CAMPO | |
$telefone->setMask('(99) 9999-9999', true); | |
TEntry::changeMask(self::$formName, 'cpf', '999.999.999-99'); | |
TEntry::changeMask(self::$formName, 'cnpj', '999.999.999-99'); |
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 | |
// DEFININDO A AÇÃO DA COMBOX TIPO PESSOA AO MUDAR DE OPÇÃO | |
$tipo_pessoa->setChangeAction(new TAction([$this,'onTipoPessoa'])); | |
// cpf_cnpj É O NOME DO CAMPO CPF / CNPJ | |
// FUNÇÃO DA COMBO TIPO PESSOA | |
public static function onTipoPessoa($param = null) | |
{ |
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 buscarEmpresa($param = null) | |
{ | |
if ($param['cnpj']) | |
{ | |
$cnpj = str_replace(['.','-','/',' '],['','','',''], $param['cnpj']); | |
$content = file_get_contents("https://www.receitaws.com.br/v1/cnpj/{$cnpj}", false, stream_context_create([ | |
"ssl" => [ |
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 | |
# VIA CONSTRUCT | |
$this->datagrid = new BootstrapDatagridWrapper($this->datagrid); | |
$this->filter_criteria = new TCriteria; | |
$unidade_id = TSession::getValue("userunitid"); | |
$this->filter_criteria->add(new TFilter('system_unit_id', '=', $unidade_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 function __construct($param = null) | |
{ | |
parent::__construct(); | |
// creates the form | |
$this->form = new BootstrapFormBuilder(self::$formName); | |
// define the form title |
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 function __construct($param = null) | |
{ | |
parent::__construct(); | |
// creates the form | |
$this->form = new BootstrapFormBuilder(self::$formName); | |
// define the form title |
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 | |
# DEFINE O ID DO BOTÃO | |
$button_entrar->id = 'tbutton_btn_entrar'; | |
# jQUERY | |
TScript::create('$("#tbutton_btn_entrar").click();'); | |
# JAVASCRIPT | |
TScript::create('document.getElementById("tbutton_btn_entrar").click();'); |
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
# ========================================================== | |
# NPM | |
# ========================================================== | |
npm set registry https://registry.npmmirror.com # 注册模块镜像 | |
npm set disturl https://npmmirror.com/mirrors/node # node-gyp 编译依赖的 node 源码镜像 | |
## 以下选择添加 | |
npm set sass_binary_site https://registry.npmmirror.com/mirrors/node-sass # node-sass 二进制包镜像 | |
npm set electron_mirror https://registry.npmmirror.com/mirrors/electron/ # electron 二进制包镜像 |
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 | |
// CRIE UMA TRANSFORMAÇÃO NA COLUNA DO DATAGRID | |
$column_situacao->setTransformer(function($value, $object, $row) | |
{ | |
$label = ''; | |
$class = ''; | |
switch ($value) { |
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
import boto3 | |
import logging | |
logs_client = boto3.client('logs') | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
def lambda_handler(event, context): | |
task_id = event['iterator']['task_id'] |
NewerOlder