Skip to content

Instantly share code, notes, and snippets.

View leandromoh's full-sized avatar
💭
Talk is Cheap, Show me the code!

Leandro Fernandes leandromoh

💭
Talk is Cheap, Show me the code!
View GitHub Profile
@leandromoh
leandromoh / currying x objects.cs
Last active April 28, 2023 16:32
demonstrates how we use currying to fixe values in FP as well we do with object fields in OOP
using System;
var greeting = (string me, int age, string friend) =>
$"Hello {friend}, my name is {me} and I am {age} years old";
var f = greeting.Curry()("Ana")(13);
Console.WriteLine(f("Bob"));
Console.WriteLine(f("Carla"));
Console.WriteLine();
@leandromoh
leandromoh / demostration how task works.cs
Created January 25, 2023 19:02
demostration how task works, C# and F#
// https://sharplab.io/#v2:C4LgTgrgdgNAJiA1AHwAICYCMBYAUKgBgAJVMA6AGQEsoBHAbj0JMwFZHcmAOEgNgB4awAHxEA4gFNgAMQD2sgBRCiVAJR4A3niI6SATj5kAIhIA2AQwCeCzAVUddLPUvvbdqAOwqOAXzx4AN3MwIgAPAGciAF4iAFEoCABbCTBzACNTCTIAJXMoAHMJGxgiW1UyAGUzCQBjYAVJGXlXXEc2vAAzWTAJcxqACwUgkNCVKDDwlqYDVF5jMysbAH0CVan8TGcAIkAeDcAQfa2WoA==
using System;
using System.Linq;
using System.Threading.Tasks;
async Task<int> GetFoo(int i)
{
await Task.Delay(10);
Console.WriteLine(i);
@leandromoh
leandromoh / SetFilterDefinition.cs
Last active August 29, 2022 19:59
SetFilterDefinition mongo
private FilterDefinition<EnumTeste> SetFilterDefinition<T>(FilterDefinition<EnumTeste> filters, string propertyName, IEnumerable<T> olds)
where T : struct, Enum
{
var bson = filters.RenderToBsonDocument();
if (bson.Contains(propertyName) is false)
return filters;
var asInteger = (T)(object)bson[propertyName].AsInt32;
(function copyStringToClipboard (str) {
var el = document.createElement('textarea');
el.value = str;
el.setAttribute('readonly', '');
el.style = {position: 'absolute', left: '-9999px'};
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
})("text to be copied to clipboard")
===========================================================
<# Start minikube #>
minikube stop; minikube start; minikube docker-env;
<# Point shell to minikube #>
& minikube -p minikube docker-env | Invoke-Expression;
<# Start docker #>
var Base64 = {
// private property
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
// public method for encoding
encode : function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
Falar de vc e do time
Falar de dificuldades e ajudas
Falar de PDI
Falar de objetivos na CIA
Coisa que incomodam
Feedbaks mutuos em geral
1 vai ficar off/sair no horario de trabalho? avisa o time
2 vai atrasar a entrega/combinado? avisa o time
3 nao gastar MUITO mais tempo numa tarefa do que deveria
talvez uns 150% 200% do tempo ideal
gastar tempo errando/aprendendo eh importante
mas se estiver dando murro em ponta de faca, eh bom pedir ajuda
4 dar visibilidade na daily sobre 1) to do 2) doing 3) done
Esqueça o tal do "Quem tem QI..."​. Para vencer seus desafios de carreira, invista cada vez mais em QE e QA.
https://www.linkedin.com/pulse/esque%C3%A7a-o-tal-do-quem-tem-qi-para-vencer-seus-de-invista-lafuente/
1º Passo da Inteligência Emocional: ideias para você e/ou sua empresa trabalharem o autoconhecimento
https://www.linkedin.com/pulse/1%C2%BA-passo-da-intelig%C3%AAncia-emocional-ideias-para-voc%C3%AA-eou-lafuente/
2º Passo da Inteligência Emocional: ideias para trabalhar a autogestão de seus sentimentos e sabotadores
https://www.linkedin.com/pulse/2%C2%BA-passo-da-intelig%C3%AAncia-emocional-ideias-para-de-seus-lafuente/
3º Passo da Inteligência Emocional: ideias para você ser uma pessoa e um líder mais empáticos
using System;
using System.Collections.Generic;
using System.Linq;
Console.WriteLine(GetFormattedName(typeof(int)));
Console.WriteLine(GetFormattedName(typeof(decimal?)));
Console.WriteLine(GetFormattedName(typeof(IEnumerable<List<string>>)));
Console.WriteLine(GetFormattedName(typeof(Dictionary<int, string>)));
static string GetFormattedName(Type type)