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
import io | |
import sys | |
from epub2txt import epub2txt | |
# Designed for use with Standard Ebooks EPUB files. | |
# May work with others, but their structure is excellent. | |
try: | |
filepath = sys.argv[1] | |
except: | |
print('usage: python3 convert.py book_to_convert.epub') |
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 onSelecionarTodos($param = null) | |
{ | |
try | |
{ | |
TScript::create('$("#builder_datagrid_check_all").trigger("click");'); | |
} | |
catch (Exception $e) |
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 Funcao | |
{ | |
public static function validarCPF($cpf, $campo) | |
{ | |
$cpf = preg_replace('/[^0-9]/is', '', $cpf); | |
if (strlen($cpf) != 11) { | |
TScript::create(" |
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 onShowDelete($object) | |
{ | |
try | |
{ | |
# CAPTURA OS GRUPOS DO USUÁRIO LOGADO | |
$grupos = TSession::getValue('usergroupids'); | |
if(in_array("1", $groupuser)) |
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 | |
# FONTE: https://framework.adianti.me/tutor/index.php?class=PDFDesignNFEView&method=onShow | |
class PDFDesignNFEView extends TPage | |
{ | |
private $form; | |
private $pdf; | |
private $total_produtos; | |
private $total_icms; |
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 | |
$css = ' | |
div[page-name="PessoaForm"] .panel-footer.card-footer { | |
display: grid; | |
grid-auto-flow: column; | |
} | |
'; | |
parent::register_css('css', $css); |
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 onLimpar($param = null) | |
{ | |
try | |
{ | |
TSession::setValue(__CLASS__.'_filter_data', NULL); | |
TSession::setValue(__CLASS__.'_filters', NULL); | |
$this->onReload(['offset' => 0, 'first_page' => 1]); |
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 | |
$produtos = Produto::where('deletado', 'IS', NULL) | |
->orderBy('data_cadastro desc, descricao', 'asc') | |
->take(10) | |
->load(); | |
# INFORMAÇÃO: | |
# ->orderBy('data_cadastro desc, descricao', 'asc') # ORDENAÇÃO PELOS CAMPOS data_cadastro E descricao | |
# ->take(10) # LIMITE DE 10 REGISTROS |
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 | |
/** | |
* ContratoList | |
* | |
* @version 1.0 | |
* @subpackage control | |
* @author Pablo Dall'Oglio | |
* @copyright Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br) | |
* @license http://www.adianti.com.br/framework-license | |
*/ |
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 debug | |
{ | |
public static function x($param = null) | |
{ | |
$debug = nl2br(htmlspecialchars(print_r($param, true))); | |
new TMessage('info', '<pre>' .' '.print_r($debug,true).''.'</pre>'); | |
exit; | |
} |
NewerOlder