Skip to content

Instantly share code, notes, and snippets.

View mariomeyrelles's full-sized avatar

Mario Meyrelles mariomeyrelles

  • São Paulo, Brazil
View GitHub Profile
@MattJOlson
MattJOlson / distsys-notes-01.md
Last active January 23, 2020 03:12
Notes on "Distributed Systems and the End of the API"

https://writings.quilt.org/2014/05/12/distributed-systems-and-the-end-of-the-api/

Distributed systems

"A distributed system is one where a machine I've never heard of can cause my program to fail" - Leslie Lamport

Cute, but "my program" is kind of quaint now, isn't it?

"...multiple processes that must communicate to perform work" - hmm, hmm, let me tell you about disk controllers. Oh wait, that's your point... almost, "an air-gapped computer" is considered nondistributed, but well whatever.

Function ConvertTo-DataTable { # https://powersnippets.com/convertto-pson/
[CmdletBinding()]Param( # Version 01.00.01, by iRon
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline = $true)] [PSObject[]]$Object, [HashTable]$ColumnType = @{}
)
$TypeCast = @{
Guid = 'Guid', 'String'
DateTime = 'DateTime', 'String'
DateTimeOffset = 'DateTimeOffset', 'String'
Byte = 'Byte', 'Char', 'Int16', 'Int32', 'Int64', 'UInt16', 'UInt32', 'UInt64', 'Decimal', 'Single', 'Double', 'String', 'Boolean'
SByte = 'SByte', 'Int16', 'Int32', 'Int64', 'Decimal', 'Single', 'Double', 'String', 'Boolean'
@Braytiner
Braytiner / Windows Defender Exclusions VS 2019.ps1
Last active November 16, 2023 18:50 — forked from dknoodle/Windows Defender Exclusions VS 2017.ps1
Adds Windows Defender exclusions for Visual Studio 2019
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\source\repos') > $null
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio Services') > $null
$pathExclusions.Add($userPath + '\AppData\Local\GitCredentialManager') > $null
import 'package:flutter/material.dart';
import 'dart:async';
void main() => runApp(TimerApp());
class TimerApp extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return new TimerAppState();
}
@benjiman
benjiman / Example.java
Created November 10, 2017 16:21
Anonymous Types with Java 10
package com.benjiweber.anontypes;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.UnaryOperator;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@samueljseay
samueljseay / es6-import-cheat-sheet.md
Created June 2, 2017 02:35
ES6 exports / imports cheat sheet
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@devhawk
devhawk / colorconsole.fs
Created August 4, 2016 17:19
F# Color Console Functions
open System
// helper function to set the console collor and automatically set it back when disposed
let consoleColor (fc : ConsoleColor) =
let current = Console.ForegroundColor
Console.ForegroundColor <- fc
{ new IDisposable with
member x.Dispose() = Console.ForegroundColor <- current }
// printf statements that allow user to specify output color
@mariomeyrelles
mariomeyrelles / Neo4jSerializationHelper.fsx
Last active July 21, 2016 12:18
A first idea on how to serialize an F# object and get a list of parameters to be used with Neo4j
type Neo4jParameterSerializer () =
member private this.readDateField (entity) (p: PropertyInfo) =
p.Name, (p.GetValue(entity) :?> DateTime).ToString("yyyy-MM-dd HH:mm:ss") :> obj
member private this.readSimpleField entity (p: PropertyInfo) = p.Name, p.GetValue(entity).ToString() :> obj
member private this.readUnionField entity (p:PropertyInfo) =
// todo: support more complex discriminated unions.
@davidfowl
davidfowl / Example1.cs
Last active June 19, 2024 16:41
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)