Skip to content

Instantly share code, notes, and snippets.

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>
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 Nov 1, 2021
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 Aug 14, 2017
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 Dec 14, 2022
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 Jul 13, 2022
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 Jun 28, 2022
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 Nov 1, 2021
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()