This file contains hidden or 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
| .signal-bar { | |
| background-color: fuchsia | |
| } | |
| .stream-view .content | |
| { | |
| background-color: peachpuff | |
| } | |
| .masthead | |
| { | |
| background-color: greenyellow; |
This file contains hidden or 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
| $nodeVersion = "4.0.0" | |
| Invoke-WebRequest "https://nodejs.org/download/release/v$nodeVersion/node-v$nodeVersion-x64.msi" -OutFile 'node.msi' | |
| # If Invoke-WebRequest is not found on your version of PS: | |
| # | |
| # $request = [System.Net.WebRequest]::Create("https://nodejs.org/download/release/v$nodeVersion/node-v$nodeVersion-x64.msi") | |
| # [System.Net.WebResponse]$response = $request.GetResponse() | |
| # $file = [System.IO.File]::OpenWrite("node.msi") | |
| # $response.GetResponseStream().CopyTo($file) | |
| # $file.Close() |
This file contains hidden or 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
| public static class EnumExtensions | |
| { | |
| public static string ToDescription(this Enum enumValue) | |
| { | |
| if (enumValue == null) | |
| return null; | |
| var memInfo = enumValue.GetType().GetMember(enumValue.ToString()); | |
| var description = (DescriptionAttribute)memInfo[0].GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault(); |
This file contains hidden or 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
| public class EnumValueParser : IValueParser | |
| { | |
| public bool CanParse(Type settingValueType) | |
| { | |
| return settingValueType.IsEnum; | |
| } | |
| public object Parse(Type settingValueType, string settingValueString) | |
| { | |
| return settingValueString.ToEnum(settingValueType); |
This file contains hidden or 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
| Local Development Installation | |
| 1. Fix a framework bug (from http://stackoverflow.com/a/30733654) before anything else | |
| a. (NHX52000) can be replaced by any machine with VS 2015 on it, like your machine. Only use the UNC as it's easier for the server instructions. | |
| b. Copy the DLL to the right to c:\temp | |
| c. From an elevated command prompt, run | |
| "\\nhx52000\c$\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\sn.exe" -Vr c:\temp\Microsoft.Cloud.Common.AzureStorage.dll | |
| d. "\\nhx52000\c$\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\gacutil" /i c:\temp\Microsoft.Cloud.Common.AzureStorage.dll | |
| 2. Run the web platform installer (or on a server use the offline mode | |
| a. Select |
This file contains hidden or 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
| public static void WaitForCgBusyCompletion(this BasePage page) | |
| { | |
| HostEx.WaitUntil(() => page.FindElements(By.ClassName("cg-busy"), TimeSpan.FromMilliseconds(100)).None(e => e.Displayed), TimeSpan.FromMinutes(1)); | |
| Thread.Sleep(TimeSpan.FromMilliseconds(100)); | |
| } | |
| public static void WaitUntil<T>(this T page, Func<T, bool> condition, TimeSpan? timeout = null) where T : Page | |
| { | |
| HostEx.WaitUntil(() => condition(page), timeout); | |
| } |
This file contains hidden or 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
| void Main() | |
| { | |
| var items = new [] { | |
| new[] {"A", "B"}, | |
| new[] {"1", "2", "3"}, | |
| new[] {"*", "+"} | |
| }; | |
| //items.Aggregate((memo, i) => memo.SelectMany (m => i.Concat(new[]{ m}).ToArray()).ToArray()).Dump(); | |
This file contains hidden or 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
| public abstract class ContainerTestsBase | |
| { | |
| private IContainer _container; | |
| private HashSet<Type> _registeredServices; | |
| readonly Autofac.Core.Activators.Reflection.DefaultConstructorFinder _ctorFinder = new Autofac.Core.Activators.Reflection.DefaultConstructorFinder(); | |
| private HashSet<Type> _genericServices; | |
| private HashSet<Type> _registeredConcretions; | |
| [TestFixtureSetUp] |
This file contains hidden or 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
| public class NancyBootstrapper : AutofacNancyBootstrapper | |
| { | |
| private readonly ILifetimeScope _container; | |
| public NancyBootstrapper(ILifetimeScope container) | |
| { | |
| _container = container; | |
| StaticConfiguration.DisableErrorTraces = _container.Resolve<EnvironmentNameSetting>().IsProduction; | |
| ApplicationPipelines.OnError.AddItemToStartOfPipeline((context, ex) => | |
| { |
This file contains hidden or 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |