Skip to content

Instantly share code, notes, and snippets.

View galvesribeiro's full-sized avatar
:shipit:
Working like hell!

Gutemberg Ribeiro galvesribeiro

:shipit:
Working like hell!
View GitHub Profile
@galvesribeiro
galvesribeiro / Orleans.codegen.cs
Last active December 12, 2015 04:52
DNX CodeGen
#if !EXCLUDE_CODEGEN
#pragma warning disable 162
#pragma warning disable 219
#pragma warning disable 414
#pragma warning disable 649
#pragma warning disable 693
#pragma warning disable 1591
#pragma warning disable 1998
[assembly: global::System.CodeDom.Compiler.GeneratedCodeAttribute("Orleans-CodeGenerator", "1.0.0.0")]
[assembly: global::Orleans.CodeGeneration.OrleansCodeGenerationTargetAttribute("Orleans, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")]
@galvesribeiro
galvesribeiro / gist:f04d8f679e6dcec1373d
Last active January 13, 2016 03:12
First test with xunit
'te.processhost.managed.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'te.processhost.managed.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\te.processhost.managed.exe'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'te.processhost.managed.exe' (CLR v4.0.30319: te.processhost.managed.exe): Loaded 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\TE.Managed.Manager.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'te.processhost.managed.exe' (CLR v4.0.30319: te.processhost.managed.exe): Loaded 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\COMMONEXTENS
@galvesribeiro
galvesribeiro / gist:4392fabeadd3d52cc0b1bae2ab1bdf0c
Last active April 22, 2016 19:23
CustomTlsHandler for DotNetty - Avoid Mono issue
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.IO;
using System.Net.Security;
using System.Runtime.ExceptionServices;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks;
@galvesribeiro
galvesribeiro / gist:48cde663cc4f7d86b2a01b2d6ff136c6
Created April 26, 2016 17:20
Hack to get DotNetty with Tls to work on Mono
internal sealed class TlsHandshakeCompletionEvent
{
public static readonly TlsHandshakeCompletionEvent Success = new TlsHandshakeCompletionEvent();
readonly Exception exception;
/// <summary>
/// Creates a new event that indicates a successful handshake.
/// </summary>
TlsHandshakeCompletionEvent()
@galvesribeiro
galvesribeiro / gist:dfee3e45887797625a7e97d66bcfc657
Created April 29, 2016 03:52
SF ServiceEventSource sample
using System;
using System.Diagnostics.Tracing;
using System.Fabric;
using System.Threading.Tasks;
namespace PI.Gateway
{
[EventSource(Name = "PI-Gateway")]
internal sealed class ServiceEventSource : EventSource
{
@galvesribeiro
galvesribeiro / Build.ps1
Created November 30, 2016 17:50
Partial Build.ps1
try {
$OSPlatform = [System.Runtime.InteropServices.OSPlatform]
$IsLinux = $Runtime::IsOSPlatform($OSPlatform::Linux)
$IsOSX = $Runtime::IsOSPlatform($OSPlatform::OSX)
$IsWindows = $Runtime::IsOSPlatform($OSPlatform::Windows)
} catch {
# If these are already set, then they're read-only and we're done
try {
$IsLinux = $false
@galvesribeiro
galvesribeiro / DbConnectionFactory.cs
Created December 1, 2016 14:29
Partial DbConnectionFactory
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data.Common;
using System.IO;
using System.Linq;
using System.Reflection;
namespace Orleans.SqlUtils
{
@galvesribeiro
galvesribeiro / IMigratable.cs
Created February 27, 2018 03:02 — forked from bboyle1234/IMigratable.cs
IMigratable
using Newtonsoft.Json;
namespace Migratable {
[JsonConverter(typeof(MigratableConverter))]
public interface IMigratable {
}
}
@galvesribeiro
galvesribeiro / Logger.cs
Created April 29, 2018 06:17
Blazor Logger
public static class Logger
{
public static void Log(object message)
{
RegisteredFunction.Invoke<bool>(
"Logger.Log",
JsonUtil.Serialize(message));
}
public static void Error(object error)
public interface IPromiseCallbackHandler
{
void SetResult(string json);
void SetError(string error);
}