Skip to content

Instantly share code, notes, and snippets.

🇦🇶

Bruno Garcia bruno-garcia

🇦🇶
Block or report user

Report or block bruno-garcia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View UE4 DSN
https://550e76353f1b41f7899e32875f22f08c@sentry.io/1512778
View Sentry scope JS
// Modifying root scope
Sentry.setTag("a","a");
// Creates a new scope and pushes in the stap, a clone of the previous one.
Sentry.pushScope();
// Here we have a tag a with value a
Sentry.setTag("a","b");
// Now a has value b
// Throw away the current scope (goes back to the previous item in the stack)
Sentry.popScope();
// Now tag a has value a
@bruno-garcia
bruno-garcia / link.xml
Created Oct 8, 2018
link.xml for Unity IL2CPP to work with Newtonsoft.Json (Tested with the Sentry SDK https://github.com/getsentry/sentry-dotnet)
View link.xml
@bruno-garcia
bruno-garcia / ASP.NET Core middleware return Exception as text on response body
Created Aug 12, 2018
ASP.NET Core middleware which return Exception as text on response body (useful when using swagger UI to test API in development instead of default HTML view)
View ASP.NET Core middleware return Exception as text on response body
using System;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
internal class ExceptionInResponseMiddleware
{
private readonly RequestDelegate _next;
View vs
@echo off
for /f %%a in ('dir /b *.sln 2^> nul') do set sln=%%a
if defined sln set sln=%cd%\%sln%
start "" /b "C:\Program Files (x86)\Microsoft Visual Studio\Preview\Community\Common7\IDE\devenv.exe" %sln%
@bruno-garcia
bruno-garcia / AssemblyExtensions.cs
Last active Apr 14, 2018
Is .NET assembly optimized
View AssemblyExtensions.cs
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
[EditorBrowsable(EditorBrowsableState.Never)]
internal static class AssemblyExtensions
{
/// <summary>
/// Whether the assembly was compiled with the optimize+ flag
/// </summary>
View keybase.md

Keybase proof

I hereby claim:

  • I am bruno-garcia on github.
  • I am brunogarcia (https://keybase.io/brunogarcia) on keybase.
  • I have a public key ASCwN-0tPUXeUT287EntKXJ-lI2FFSi3bJ9EZS-LDMce_Ao

To claim this, I am signing this object:

View FollowRefReturn.cs
class Program
{
static void Main()
{
var a = 1;
ref var b = ref Increment(ref a);
b++;
var c = Increment(ref b);
c++;
System.Console.WriteLine($@"a: {a}
View fixed span on func by using action and ignoring arg.cs
[Fact]
public void Serialize_NullObject_ThrowsNullArgument()
{
var sut = new MessagePackSerializer(new MessagePackOptions());
Assert.Throws<ArgumentNullException>(() => { sut.Serialize((object) null); });
}
View test broken due to generic func returning span.cs
[Fact]
public void Serialize_NullObject_ThrowsNullArgument()
{
var sut = new MessagePackSerializer(new MessagePackOptions());
Assert.Throws<ArgumentNullException>(() => sut.Serialize((object) null));
}
You can’t perform that action at this time.