- Create
UNLOGGED
table. This reduces the amount of data written to persistent storage by up to 2x. - Set
WITH (autovacuum_enabled=false)
on the table. This saves CPU time and IO bandwidth on useless vacuuming of the table (since we neverDELETE
orUPDATE
the table). - Insert rows with
COPY FROM STDIN
. This is the fastest possible approach to insert rows into table. - Minimize the number of indexes in the table, since they slow down inserts. Usually an index
on
time timestamp with time zone
is enough. - Add
synchronous_commit = off
topostgresql.conf
. - Use table inheritance for fast removal of old data:
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 | |
TTransaction::open(self::$database); | |
$vendas = Venda::where('cliente_id','=', $cliente_id)->load(); | |
$lista_vendas = array(); | |
foreach ($vendas as $venda) { | |
array_push($lista_vendas, $venda->toArray()); |
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 = str_replace(['.','-'], ['',''], $cep); | |
$cpf = str_replace(['.','-'], ['',''], $cpf); | |
$cnpj = str_replace(['.','/','-'], ['','',''], $cnpj); | |
$celular = str_replace(['(',')','-',' '], ['','','',''], $celular); |
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 | |
TScript::create( " | |
setInterval(function () { | |
Adianti.waitMessage = 'Carregando'; | |
__adianti_post_data('form_PedidosList', 'class=PedidosList&method=onReload'); | |
return false; | |
}, 10000); // 10000 milliseconds => 10 segundos | |
"); |
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 | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
/* SMTP - CONEXÃO | |
587 > TLS | |
465 > SSL | |
G-MAIL: |
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
你长的怪像人殊不知是只人面犬 | |
你的脸有碍观瞻 | |
当初惊艳,完完全全,只为世面见得少。 | |
嫉妒是一种不好的情感,我理解你嫉妒我有家人,可你这么说有点过分了 | |
你自拍一张就是你的全家福 | |
远看是美景,近看想报警 | |
你在无中生有 你在暗度陈仓 你在凭空想象 你在凭空捏造 你在无言无语 你在无可救药 你是逝者安息 你是一路走好 你是傻子巴拉 你是永无止境 你是没钱买药 你是头脑有病 你是眼里有泡 你是嘴里刘能 你是污言秽语 你是咎由自取 你是殃及无辜 你是祸害众生 你是仓皇失措 你是暗度陈仓 你是无可救药 | |
胖姑娘袭花衫,花都胖起来。 | |
即使是做咸鱼,也要做最咸的那一条。 | |
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 VendaGraficoBarChart extends TPage | |
{ | |
private $form; | |
private $loaded; | |
private static $database = 'exemplos'; | |
private static $activeRecord = 'VendaGrafico'; | |
private static $primaryKey = 'id'; | |
private static $formName = 'form_VendaGrafico'; |
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 | |
use Adianti\Base\AdiantiFileSaveTrait; | |
public function __construct( $param ) | |
{ | |
parent::__construct(); | |
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 SwiftUI | |
import Combine | |
struct AdaptsToSoftwareKeyboard: ViewModifier { | |
@State var currentHeight: CGFloat = 0 | |
func body(content: Content) -> some View { | |
content | |
.padding(.bottom, currentHeight) | |
.edgesIgnoringSafeArea(.bottom) |
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 | |
/* IMPORTAR O CSS e JS DO sweetalert2 NO HTML | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.4.18/sweetalert2.css" rel="stylesheet" type="text/css" media="screen" /> | |
<script src='https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.4.18/sweetalert2.js' type='text/javascript'></script> | |
*/ | |
TScript::create(" | |
Swal.fire( | |
'SUCESSO!', |
NewerOlder