Skip to content

Instantly share code, notes, and snippets.

View andre-f-paggi's full-sized avatar

André Franciscato Paggi andre-f-paggi

View GitHub Profile
Nomes das Tabelas
SX1 Manutenção de Perguntas de parametrização (movimentações, consultas e relatórios)
SX2 Manutenção dos Arquivos
SX3 Manutenção dos Campos
SX4 Configuração de Agenda de Relatórios e Processos
SX5 Manutenção de Tabelas
SX6 Manutenção de Parâmetros
SX7 Manutenção de Gatilhos de Campos (SX3)
SX9 Manutenção de Relacionamento entre Arquivos (SX2)
SXA Manutenção de Pastas Cadastrais dos Arquivos (SX2)
private byte[] ResizeImg(byte[] originalImageBuffer)
{
using var ms = new MemoryStream(originalImageBuffer);
using (var originalImage = new Bitmap(Image.FromStream(ms)))
{
var maxWidthInPixels = 300;
int height = originalImage.Height;
int width = originalImage.Width;
@andre-f-paggi
andre-f-paggi / cloudSettings
Last active May 14, 2021 02:44
VS Code Settings Sync
{"lastUpload":"2021-05-14T02:44:08.109Z","extensionVersion":"v3.4.3"}
@andre-f-paggi
andre-f-paggi / rename-branch-git.sh
Created May 26, 2019 22:48 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@andre-f-paggi
andre-f-paggi / google-chart-colors.js
Created March 3, 2019 18:33
google-chart-colors
var colors = [
'#3366cc',
'#dc3912',
'#ff9900',
'#109618',
'#990099',
'#0099c6',
'#dd4477',
'#66aa00',
'#b82e2e',
@andre-f-paggi
andre-f-paggi / Front end REST Url Route Scheme
Created November 19, 2018 14:38
Front end REST Url Route Scheme
Link: https://stackoverflow.com/a/26010029
/items/ - this is for listing items
/items/{id:[0-9]{1,4}} - this is for displaying one item in detail
/items/add - for displaying new item form
/items/:id/edit - for displaying existing item in Form for editing
/items/:id/delete - **This is not required, I mean you just hit the API when
use clicks delete, we cant show any deletion form**
@andre-f-paggi
andre-f-paggi / Enumeration.cs
Last active March 10, 2020 00:19
Enumeration.cs -> Enum class
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
/// <summary>
/// Fonte do Código: https://github.com/HeadspringLabs/Tarantino/blob/master/src/Tarantino.Core/Commons/Model/Enumerations/Enumeration.cs
/// </summary>
@andre-f-paggi
andre-f-paggi / SerializeObjToJson.cs
Created October 1, 2018 14:18
Serialize C# object to JSON in immediate window
Newtonsoft.Json.JsonConvert.SerializeObject(myObj, Newtonsoft.Json.Formatting.None, new Newtonsoft.Json.JsonSerializerSettings(){ ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore })
@andre-f-paggi
andre-f-paggi / repo.cs
Created April 30, 2018 21:50
MultiMapping Dapper + AutoMapper - .Net Core
public CompraParaAprovarPagamentoDTO ObterCompraParaAprovarPagamentoDTO(int idCompra)
{
using (SqlConnection conexao = new SqlConnection(_config.GetConnectionString("DbLoja")))
{
var sql = $@"
select
'IdCompra' = Compra.IdCompra,
'Pagamentos_Sequencial' = CompraFormaPagamento.Sequencial,
'Pagamentos_ValorJuros' = (select sum(CompraFormaPagamento.ValorJuros) from CompraFormaPagamento CFP where CFP.IdCompraFormaPagamento = CompraFormaPagamento.IdCompraFormaPagamento),
'Pagamentos_ValorMeioPagamento' = (select sum(CompraFormaPagamento.ValorComJuros) from CompraFormaPagamento CFP where CFP.IdCompraFormaPagamento = CompraFormaPagamento.IdCompraFormaPagamento),
@andre-f-paggi
andre-f-paggi / dbForge SQL Complete Config.xml
Created April 17, 2018 17:25
dbForge SQL Complete Config
<FormatProfile Name="Default" LanguageId="{3e02aa62-f0e5-43bf-ae87-c70419725a15}">
<FormatOptions>
<PropertyValue Name="Select_SingleLine_WhenRightMarginIsNotExceeded">false</PropertyValue>
<SubOptions Name="Select_SingleLine_WhenQueryIsShorterThanXCharacters">
<PropertyValue Name="Checked">false</PropertyValue>
<PropertyValue Name="Value">50</PropertyValue>
</SubOptions>
<SubOptions Name="Select_SingleLine_WhenQueryContainsLessThanXWords">
<PropertyValue Name="Checked">false</PropertyValue>
<PropertyValue Name="Value">10</PropertyValue>