Skip to content

Instantly share code, notes, and snippets.

View luishgp's full-sized avatar

Luis Henrique luishgp

View GitHub Profile
@luishgp
luishgp / Dockerfile
Created February 24, 2024 00:01
Dockerfile Alpine with gRPC
FROM php:8.2-fpm-alpine AS build-base
# Install build packages
RUN apk update && apk add --no-cache --virtual \
build-essentials \
linux-headers \
curl \
git \
grep \
build-base \
SELECT
'PDUPREC' AS "TABELA",
PDUPREC.MLK_IDREFINT,
VDUPREC.EMPRESA,
VDUPREC.CLIENTE AS NUMEROCM,
CONTAMOV.NOME AS CONTAMOV_NOME,
NULL AS CONTAMOVLAN_TIPO,
NULL AS CONTAMOVLAN_SEQCM,
VDUPREC.DUPREC,
VDUPREC.HISTORICO,
@luishgp
luishgp / sql-conta.sql
Last active October 8, 2021 15:25
SQL Contas
SELECT
'PDUPREC' AS "TABELA",
PDUPREC.MLK_IDREFINT,
VDUPREC.EMPRESA,
VDUPREC.CLIENTE AS NUMEROCM,
CONTAMOV.NOME AS CONTAMOV_NOME,
NULL AS CONTAMOVLAN_TIPO,
NULL AS CONTAMOVLAN_SEQCM,
VDUPREC.DUPREC,
VDUPREC.HISTORICO,
@luishgp
luishgp / DataGet.php
Last active October 8, 2021 14:56
Método DataGet
<?php
if (!function_exists('value')) {
/**
* Return the default value of the given value.
*
* @param mixed $value
* @return mixed
*/
function value($value)
@luishgp
luishgp / InsideBars.pas
Last active January 14, 2021 13:53
Inside Bars
var
BuyOversold, BuyEden : Boolean;
Stoch, Target, Stop, BuyAt : Float;
begin
Stoch := SlowStochastic(8)[1];
BuyOversold := ((HIGH[1] < HIGH[2]) and (LOW[1] > LOW[2]) and (Stoch < 20));
BuyEden := ((HIGH[1] < HIGH[2]) and (LOW[1] > LOW[2]) and ((CLOSE[1] > MediaExp(8, CLOSE)[1]) and (CLOSE[1] > MediaExp(80, CLOSE)[1])));
if ((BuyOversold or BuyEden) and (BuyPosition = 0)) then
-- Dropa a trigger antiga
DROP TRIGGER itinerario_total_km_data_hora ON coleta.itinerario;
-- Altera o tipo do campo
ALTER TABLE coleta.itinerario ALTER COLUMN data_hora_total TYPE interval(6) USING data_hora_total::interval;
-- Cria a nova função
CREATE OR REPLACE FUNCTION coleta.itinerario_atualiza_km_duracao()
RETURNS trigger
LANGUAGE plpgsql
[
{
"type": "quality",
"collectionInField": "2020-03-16",
"service": "providers",
"samples": [
{
"type": "valid",
"identifier": "424584559",
"analyzed": "2020-03-20T00:00:00",
@luishgp
luishgp / bath.php
Created April 7, 2020 20:44
Update me batch firestore
<?php
$batch = $firestore->batch();
$ref = $firestore->collection('teste')->document($collect);
$batch->update($ref, [
['path' => 'nome_usuario_coleta', 'value' => 'Teste de Atualização em Batch']
]);
$request->validate([
'id_coleta' => 'required|uuid',
'alizarol' => 'required|string',
'codigo_produtor' => 'required|numeric',
'data' => 'required|date_format:Y-m-d H:i:s',
'hora_chegada' => 'required|date_format:H:i',
'hora_saida' => 'required|date_format:H:i',
'id_equipamento' => 'required|uuid',
'id_itinerario' => 'required|uuid',
'id_laticinio' => 'required|uuid',
Financeiro:
Contas a receber:
- Geração
- Quitação
- Edição
- Reparcelamento
- Recebimento com cheque
- Recebimento com dinheiro
- Recebimento com cartão