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
| using System.Data; | |
| using Npgsql; | |
| using Nancy; | |
| using Dapper; | |
| namespace NancyApplication1 | |
| { | |
| public class IndexModule : NancyModule | |
| { | |
| private const string ConnectionString = "Server=localhost;User Id=postgres;password=Postgres1234;database=demo"; |
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
| angular.module('ui.textbox', []) | |
| .directive('textbox', [function () { | |
| return { | |
| restrict: 'E', | |
| replace: true, | |
| require: '^form', | |
| scope: { | |
| model: '=', | |
| name: '=', | |
| uiName: '@', |
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
| angular.module('profile.changePwd.pwdValidate', []) | |
| .directive('pwdValidate', function () { | |
| return { | |
| require: 'ngModel', | |
| restrict: 'A', | |
| template: '<input data-placement="right" bs-popover="passwordRules" data-hide="hidePopup" data-trigger="focus">', | |
| replace: true, | |
| transclude: 'element', | |
| link: function (scope, element, attrs, ctrl) { | |
| ctrl.$parsers.unshift(function (viewValue) { |
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 PosItemProjection_ByCategoryId : AbstractIndexCreationTask<PosItemProjection> | |
| { | |
| public PosItemProjection_ByCategoryId() | |
| { | |
| Map = items => from item in items select new { item.CategoryId }; | |
| Index(x => x.CategoryId, FieldIndexing.NotAnalyzed); | |
| } | |
| } |
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
| static using_a_wired_environment() | |
| { | |
| DocumentStore = new EmbeddableDocumentStore | |
| { | |
| RunInMemory = true, | |
| Conventions = { JsonContractResolver = new RavenContractResolver(true), MaxNumberOfRequestsPerSession = int.MaxValue, } | |
| }; | |
| DocumentStore.Conventions.CustomizeJsonSerializer = jsonSerializer => { jsonSerializer.ConfigureForNodaTime(DateTimeZoneProviders.Bcl); }; | |
| DocumentStore.RegisterListener(new NoStaleQueriesAllowed()); |
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 EnumerationJsonConverter : JsonConverter | |
| { | |
| public override bool CanConvert(Type objectType) | |
| { | |
| return IsEnumeration(objectType); | |
| } | |
| public bool IsEnumeration(Type type) | |
| { | |
| if (type == null || type.BaseType == null || !type.BaseType.IsGenericType) return false; |
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
| function prompt | |
| { | |
| $(get-location) + "> " | |
| } | |
| function Get-Batchfile ($file) { | |
| $cmd = "`"$file`" & set" | |
| cmd /c $cmd | Foreach-Object { | |
| $p, $v = $_.split('=') | |
| Set-Item -path env:$p -value $v |
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
| var bus = BusSetup.StartWith<Conservative>() | |
| .Apply<IoCSupport>(s => s.SetAdapter(new StructureMapAdapter()) | |
| .SetHandlerInterface(typeof(IHandleMessage<>))) | |
| .Construct(); | |
| public class StructureMapAdapter : IocAdapter | |
| { | |
| public IEnumerable<object> GetAllInstances(Type desiredType) | |
| { |
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
| using System; | |
| using System.Collections.Generic; | |
| using Microsoft.ServiceBus; | |
| using Microsoft.ServiceBus.Messaging; | |
| namespace Infrastructure.Azure | |
| { | |
| public class ServiceBus | |
| { |
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 PersonSummaryIndex : AbstractIndexCreationTask<PersonProjection> | |
| { | |
| public PersonSummaryIndex() | |
| { | |
| Map = people => from person in people | |
| select new | |
| { | |
| person.Id, | |
| Query = new object[] | |
| { |