This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Common.Extensions | |
{ | |
public static class NumberExtensions | |
{ | |
public static void Times(this int i, Action<int> action) | |
{ | |
for (var n = 0; n < i; n++) action(n); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
namespace Common.Extensions | |
{ | |
public static class DateExtensions | |
{ | |
public static DateTime January(this int year, int day) | |
{ | |
return new DateTime(year, 1, day); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Common.Extensions | |
{ | |
public static class StringExtensions | |
{ | |
public static T AsEnum<T>(this string enumName) | |
{ | |
return (T)Enum.Parse(typeof(T), enumName, true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
namespace Common.Extensions | |
{ | |
public static class ObjectExtensions | |
{ | |
public static TProperty GetOrDefault<TObject, TProperty>(this TObject entity, Func<TObject, TProperty> property) | |
{ | |
return entity.GetOrDefault(property, default(TProperty)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Represents a globally unique identifier (GUID) with a | |
/// shorter string value. Sguid | |
/// </summary> | |
public struct ShortGuid | |
{ | |
#region Static | |
/// <summary> | |
/// A read-only instance of the ShortGuid class whose value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------------------------------------------------------- | |
// <copyright file="PatternMatch.cs" company="Akka.NET Project"> | |
// Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com> | |
// Copyright (C) 2013-2015 Akka.NET project <https://github.com/akkadotnet/akka.net> | |
// </copyright> | |
//----------------------------------------------------------------------- | |
using System; | |
namespace Akka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2011 gitblit.com. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net.Mail; | |
using Gurock.SmartInspect; | |
public class MailProtocol: Gurock.SmartInspect.Protocol | |
{ | |
private string fHost; | |
private int fPort; | |
private string fTo; | |
private string fFrom; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Script authored by Hrusikesh Panda (inspired from safeServiceStop script by Erik Falksen) | |
IF [%1]==[] GOTO usage | |
IF NOT "%2"=="" SET server=%2 | |
SC %server% query %1 >NUL | |
IF errorlevel 1060 GOTO ServiceNotFound | |
IF errorlevel 1722 GOTO SystemOffline | |
IF errorlevel 1001 GOTO DeletingServiceDelay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For ($i=1; $i -le 3; $i++) { | |
$node = "node-" + $i | |
docker-machine create -d hyperv --hyperv-virtual-switch "docker" --hyperv-memory 1024 $node | |
docker-machine ssh $node "echo 'vm.max_map_count=262144' | sudo tee -a /etc/sysctl.conf && sudo sysctl -p" | |
} | |
docker-machine env node-1 | Invoke-Expression | |
docker swarm init --advertise-addr $(docker-machine ip node-1) |
OlderNewer