Skip to content

Instantly share code, notes, and snippets.

View gabrielsimas's full-sized avatar
Always happy and ready to coding the World!

Gabriel Simas gabrielsimas

Always happy and ready to coding the World!
View GitHub Profile
View ConcurrentDictionaryExtensions.cs
using System;
using System.Threading.Tasks;
namespace System.Collections.Concurrent
public static class ConcurrentDictionaryExtensions
/// <summary>
/// Provides an alternative to <see cref="ConcurrentDictionary{TKey, TValue}.GetOrAdd(TKey, Func{TKey, TValue})"/> that disposes values that implement <see cref="IDisposable"/>.
/// </summary>
LeyTT / tabelas_sinacor
Created April 2, 2020 14:45
Tabelas Sinacor
View tabelas_sinacor
Prefixo das Tabelas
TSC = Clientes
TCC = Conta Corrente
TTS = Tesouraria
TOR = Ordens Bolsa
TBO = Faturamento Bolsa
TCA = Controle de Acesso
TMF = Faturamento de BM&F
TCF = Custodia
TGE = Controle de Empresas
russcam / completion-suggester.cs
Last active November 1, 2021 00:52
Using Completion Suggester with NEST
View completion-suggester.cs
void Main()
var indexName = "stackoverflow";
var node = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
var settings = new ConnectionSettings(node)
.InferMappingFor<Question>(m => m
rdakar / Validação de CPF e CNPJ - C#
Created August 14, 2017 21:02
Validação de CPF e CNPJ - C#
View Validação de CPF e CNPJ - C#
namespace CpfCnpj
public static class CpfCnpjUtils
public static bool IsValid(string cpfCnpj)
return (IsCpf(cpfCnpj) || IsCnpj(cpfCnpj));
private static bool IsCpf(string cpf)
quangnd / reduceExamples.js
Last active November 24, 2023 19:57
Some examples about reduce() in Javascript
View reduceExamples.js
//Example 1 - Calculate average value of an array (transform array into a single number)
var scores = [89, 76, 47, 95]
var initialValue = 0
var reducer = function (accumulator, item) {
return accumulator + item
var total = scores.reduce(reducer, initialValue)
var average = total / scores.length
/*Explain about function
OllieJones / DataTableResultSet.cs
Last active March 3, 2023 22:16
C# code for handling Ajax calls for the client table-rendering plugin.
View DataTableResultSet.cs
/// <summary>
/// Resultset to be JSON stringified and set back to client.
/// </summary>
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class DataTableResultSet
/// <summary>Array of records. Each element of the array is itself an array of columns</summary>
public List<List<string>> data = new List<List<string>>();
ghinda /
Last active October 17, 2023 10:16
git csv export of commits in the last month
git log --since='last month' --pretty=format:'%h;%an;%ad;%s' --author='Ionut Colceriu' > ~/log.csv
jsauve / AsyncDapperDemo.cs
Last active August 18, 2023 17:58
Async Dapper Demo. Includes buffered and non-buffered connection helpers.
View AsyncDapperDemo.cs
using System;
using System.Linq;
using System.Data;
using System.Data.SqlClient;
using System.Threading.Tasks;
using Dapper;
public class Program
public static void Main()