Skip to content

Instantly share code, notes, and snippets.

View tporto's full-sized avatar

Thiago Porto tporto

  • Linx
  • Brasil
View GitHub Profile
@tporto
tporto / clean.sh
Created April 26, 2022 13:29 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@tporto
tporto / negociacao-boleto-change-duedate.service.ts
Created December 11, 2021 14:44
Chamo na negociação o service do boleto, dando tudo certo atualizo a parcela da negociação (modules -> negociacoes -> services
import {
Injectable,
Logger,
NotFoundException,
UnprocessableEntityException,
} from '@nestjs/common';
import * as moment from 'moment-timezone';
import { getManager } from 'typeorm';
import { HistoricoCategoriaType } from '@/common/types/historico.types';
@tporto
tporto / boleto-change-duedate.service.ts
Created December 11, 2021 14:42
Esse é um outro módulo que pega o que retornou da API, valida e salva na tabela (modules -> boleto -> services)
import { Injectable, Logger } from '@nestjs/common';
import { dateTimeNow } from '@/common/util';
import { Boleto, ModelProvider } from '@/modules/database/providers/model.provider';
import { FitbankBoletoService } from '@/modules/fitbank/services/fitbank-boleto.service';
import { IBoletoResult } from '../types/boleto.interface';
import { BoletoStatusType } from '../types/boleto.types';
@Injectable()
@tporto
tporto / fitbank-boleto.service.ts
Created December 11, 2021 14:39
Faz somente a comunicação com a API da Fitbank e trata os eventos (modules/fitabnk/services/fitbank-boleto.service.ts)
import { HttpService, Injectable, Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { AxiosRequestConfig, AxiosResponse } from 'axios';
import { dateWithoutTime } from '@/common/util';
import { IBoletoResult, IBoletoCreatedInfo } from '../../boleto/types/boleto.interface';
@Injectable()
export class FitbankBoletoService {
FROM hexpm/elixir:1.11.2-erlang-23.1.2-alpine-3.12.1 as build
# install build dependencies
RUN apk add --update git build-base npm nodejs python3
# prepare build dir
RUN mkdir /app
WORKDIR /app
# install hex + rebar
<template>
<div>
<button @click="status = !status">change status</button> {{ status }}
<br>
<div v-for="m in marcas">
<input type="checkbox" :value="m.id" v-model="checkedNames" v-on:click="click_marca(m.id)" /> {{ m.nome }}
</div>
<ul>
<li v-for="m in marcas">
//certificado A1
if configuracao_nf.CERTIFICADO_DIGITAL_MODELO = '1' then
begin
//se não tiver certificado
if configuracao_nf.CERTIFICADO_DIGITAL_NOME = '' then
begin
result.code := 0;
result.message := 'Certificado não configurado';
exit;
end;
@tporto
tporto / nf.pas
Last active March 1, 2019 17:05
Função para obter a chave nfe - rejeição 539, 613, 217
class function TNfController.get_chaveacesso_rejeicao539(mensagem: string
): string;
var
s: TStringList;
i: integer;
str_value: string;
begin
result := '';
s := TStringList.Create;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import datetime
try:
import httplib # Python 2.7
except ImportError:
@tporto
tporto / install_elixir.md
Created July 28, 2018 13:34 — forked from rubencaro/install_elixir.md
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.