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 AzureFriendlyReplicationInformer : ReplicationInformer | |
| { | |
| public AzureFriendlyReplicationInformer(DocumentConvention conventions) | |
| : base(conventions) | |
| { | |
| } | |
| public override bool ShouldExecuteUsing(string operationUrl, int currentRequest, string method, bool primary) | |
| { | |
| if (primary == 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
| var patchCommands = new List<ScriptedPatchCommandData>(); | |
| foreach (var relatedDocument in relatedDocuments) | |
| { | |
| var photo = new Photo | |
| { | |
| Url = imageMetadata.Id, | |
| Title = imageMetadata.Title, | |
| Description = imageMetadata.Description, | |
| SortOrder = relatedDocument.Value, | |
| }; |
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 ReservationLetterTransformer : AbstractTransformerCreationTask<Reservation> | |
| { | |
| public ReservationLetterTransformer() | |
| { | |
| TransformResults = reservations => from res in reservations | |
| let person = LoadDocument<Person>(res.PrimaryPersonId) | |
| let members = LoadDocument<Person>(res.Group.MemberPersonIds) | |
| let assignments = LoadDocument<ReservationUnitAssignment>(res.UnitAssignmentIds) | |
| let units = LoadDocument<Unit>(assignments.Select(assign => assign.UnitId).Distinct()) | |
| let invoices = LoadDocument<Invoice>(res.InvoiceIds) |
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
| internal class Program | |
| { | |
| private static void Main() | |
| { | |
| var s = "TEST STRING"; | |
| var lower = s.Aggregate(string.Empty, (current, c) => current + char.ToLower(c)); | |
| Debug.Assert(lower == "test string"); | |
| } | |
| } |
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 AzureConManagerSqlPersistenceWireupExtensions | |
| { | |
| public static SqlPersistenceWireup UseInAzureConfiguredSqlPersistence(this Wireup wireup, string connectionName) | |
| { | |
| var factory = new AzureConfigurationConnectionFactory(connectionName); | |
| return new SqlPersistenceWireup(wireup, factory); | |
| } | |
| } | |
| public class AzureConfigurationConnectionFactory : ConfigurationConnectionFactory |
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; | |
| namespace ConsoleApplication28 | |
| { | |
| internal class Program | |
| { | |
| public delegate bool GetNum(string prompt, out int val); | |
| private static readonly Dictionary<GuessAnswerKey, Func<int, string>> answerMap = new Dictionary |
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
| #<localhost> | |
| 127.0.0.1 localhost | |
| 127.0.0.1 localhost.localdomain | |
| 255.255.255.255 broadcasthost | |
| ::1 localhost | |
| 127.0.0.1 local | |
| 127.0.0.1 goatse.cx # More information on sites such as | |
| 127.0.0.1 www.goatse.cx # these can be found in this article | |
| 127.0.0.1 oralse.cx # en.wikipedia.org/wiki/List_of_shock_sites | |
| 127.0.0.1 www.oralse.cx |
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 IDocumentSessionExtensions | |
| { | |
| private static readonly Policy RetryPolicy = Policy | |
| .Handle<WebException>(ex => TransientErrors.Contains(ex.Status)) | |
| .WaitAndRetry(new[] | |
| { | |
| TimeSpan.FromSeconds(1), | |
| TimeSpan.FromSeconds(2), | |
| TimeSpan.FromSeconds(3) | |
| }); |
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
| public class Office | |
| { | |
| public string Id { get; set; } | |
| public string CompanyName { get; set; } | |
| } | |
| public class OfficeIndex : AbstractIndexCreationTask<Office> | |
| { | |
| public OfficeIndex() | |
| { |