Skip to content

Instantly share code, notes, and snippets.

@brunomlopes
brunomlopes / RavenDbIssueWithAtSymbol.cs
Created June 1, 2017 17:12
Unit test for a problem with queries with @ symbols
class Entity
{
public string Id { get; set; }
public string AuthorId { get; set; }
public string Title { get; set; }
public string Language { get; set; }
}
class Index : AbstractIndexCreationTask<Entity>
{
@brunomlopes
brunomlopes / sendeml.csx
Created October 8, 2015 19:26
Scriptcs file to send a bunch of .eml files
/*
Run
> scriptcs -install Lumisoft.Net.dll
To install Lumisoft.net
*/
using LumiSoft.Net;
using System.IO;
using System.Linq;
using LumiSoft.Net.SMTP.Client;
using System;
using Microsoft.Framework.DependencyInjection;
namespace weListen.Infrastructure.Workers.Sanitization
{
public static class ExtensionMethods
{
public static IServiceCollection RegisterEngines(this IServiceCollection services)
{
return services.AddScoped<EngineA>()
@brunomlopes
brunomlopes / IsInAsyncErrorInRavenDb.cs
Last active August 29, 2015 14:27
Test case for bug? Tested on 3.0.3751-Unstable and 3.0.3690
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Raven.Client;
using Raven.Client.Embedded;
using Raven.Client.Indexes;
using Raven.Client.Linq;
using Raven.Tests.Helpers;
using Xunit;
@brunomlopes
brunomlopes / typeinference.cs
Last active August 29, 2015 14:24
c# Type inference failed me?
using System.Linq;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
// Error 1 The type arguments for method 'ConsoleApplication4.Program.MethodCall<TResult,TIndex,TTransformer>(TIndex)' cannot be inferred from the usage. Try specifying the type arguments explicitly. d:\documents\documents\visual studio 2013\Projects\ConsoleApplication4\ConsoleApplication4\Program.cs 9 13 ConsoleApplication4
MethodCall(new MultiLanguage_EntityIndex_MapReduces());
<?xml version="1.0" encoding="UTF-8"?>
<meta-runner name="Meta (CaioProiete): Initialize build and set custom parameters">
<description>Initialize the build and set the value of some custom parameters that can be used during the build, such as version, timestamp, and others</description>
<settings>
<parameters>
<param name="mr.initialize_build.releaseBranch" value="%build.releaseBranch%" spec="text label='Release Branch:' description='The name of the branch from where production releases are generated' display='normal' validationMode='not_empty'" />
<param name="mr.initialize_build.verbose" value="SilentlyContinue" spec="checkbox checkedValue='Continue' description='Log verbose messages?' display='normal' label='Verbose:' uncheckedValue='SilentlyContinue'" />
</parameters>
<build-runners>
<runner name="Initialize build and set custom parameters" type="jetbrains_powershell">
.hljs {
display:block;
overflow-x:auto;
padding:.5em;
color:#333;
background:#f8f8f8;
-webkit-text-size-adjust:none
}
.hljs-comment,.hljs-template_comment,.diff .hljs-header,.hljs-javadoc {
@brunomlopes
brunomlopes / NuGet_profile.ps1
Created January 7, 2015 10:11
Visual Studio presenter utils
# Changes the font size for the text editor. Very useful when presenting, to make it bigger
function Set-FontSize {
param(
[ValidateRange(6, 128)]
[Parameter(position=0, mandatory=$true)]
[int]$Size
)
$dte.Properties("FontsAndColors", "TextEditor").Item("FontSize").Value = $Size
}
@brunomlopes
brunomlopes / RedisCharacterizationTest.cs
Last active August 29, 2015 14:12
RedisCharacterizationTest for diferent databases using ServiceStack.Redis
using System;
using ServiceStack.Redis;
using Xunit;
namespace SocialStack.Tests.Integration.Infrastructure
{
public class RedisCharacterizationTest : IDisposable
{
private IRedisClientsManager _db1ClientManager;
private IRedisClientsManager _db2ClientManager;