Skip to content

Instantly share code, notes, and snippets.

View fabiomarreco's full-sized avatar

Fabio Catunda Marreco fabiomarreco

View GitHub Profile
set number
set relativenumber
set ignorecase
set smartcase
let mapleader = "\<Space>"
nnoremap - ^
nnoremap + $
nnoremap <Tab> :bnext<cr>
nnoremap <M-o> <C-]>
" Plugins
call plug#begin(stdpath('data') . '/plugged')
Plug 'morhetz/gruvbox'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
"Plug 'yuki-yano/fzf-preview.vim', { 'branch': 'release/rpc' }
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
" Plug 'roxma/nvim-completion-manager'
@fabiomarreco
fabiomarreco / ResultMonadExample.cs
Last active November 28, 2019 10:18
Quick example for a Result Monad
using System;
using System;
using System.Collections;
using System.Collections.Generic;
namespace ResultMonadExample
{
public Result<IBasket> AddToBasketV3(string productId, string customerId)
@fabiomarreco
fabiomarreco / CompleteGenericVisitor.cs
Created October 23, 2019 13:27
Sample for Generic Visitor as shown on blog post
using Xunit;
namespace SampleSpecifications
{
//************** GENERIC SPECIFICATION (SHARED LIBRARY) *********************//
public interface ISpecificationVisitor<TVisitor, T> where TVisitor : ISpecificationVisitor<TVisitor, T>
{
void Visit(AndSpecification<T, TVisitor> spec);
void Visit(OrSpecification<T, TVisitor> spec);
void Visit(NotSpecification<T, TVisitor> spec);
@fabiomarreco
fabiomarreco / Exercies1 Mentorship fsharp.md
Created September 23, 2019 00:41
1st exercises mentorship fsharp

F# Exercises

FizzbuzzImperative

module FizzbuzzImperative =
    let nums = [1..100]

    let fizzbuzzImperative i = 
        if i % 3 = 0 && i % 5 = 0 then
            printfn "fizzbuzz"
@fabiomarreco
fabiomarreco / list-dependencies.fsx
Created April 16, 2018 13:31
Script to list dependencies and license from nuget
//asdasda
#load @"C:/Utilities/fsharp-iteractive/load-all.fsx"
open System.ComponentModel
//#load @"C:\Utilities\fsharp-iteractive\packages\FsLab\FsLab.fsx"
#r "FSharp.Data.dll"
#r "System.Xml.dll"
#r "System.Xml.Linq.dll"
#r "FsPickler.dll"
#r "FsPickler.Json.dll"
@fabiomarreco
fabiomarreco / Maybe.cs
Last active January 26, 2018 11:40
Maybe implementation in C#
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using ProtoBuf;
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}]"
else
echo ""
fi
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RiskControl.Common.Tools.Types
@fabiomarreco
fabiomarreco / servicefactory.cs
Last active November 13, 2015 16:25
Creating new Service Reference from Known Service Interface
interface IServiceInterfaceChannel : IServiceInterface, IClientChannel
{
}
class Program
{
void Main()
{
var factory = new ClientFactory<IServiceInterfaceChannel>();