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
| set transaction isolation level read uncommitted | |
| select | |
| c.[Id], | |
| c.[Name], | |
| c.[SentOn], | |
| count(s.Id) as sent, | |
| sum(s.[Bounced]) as bounced, | |
| sum(s.[Complained]) as complained, | |
| sum(s.[Opened]) as opened, |
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 compare = function (a, b) { | |
| var i = 0; | |
| for (; i < a.length; i++) { | |
| if (a[i] != b[i]) { | |
| return (a[i] > b[i]) ? 1 : -1; | |
| } | |
| } | |
| return 0; |
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
| require 'digest' | |
| require 'json' | |
| require 'fileutils' | |
| $leaderboard_count = 5 | |
| $user_count = 200000 | |
| def username(i) | |
| Digest::SHA1.hexdigest(i.to_s) | |
| end |
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
| class Organization | |
| def to_param | |
| "42" | |
| end | |
| def saved? | |
| rand > 0.5 | |
| end | |
| end | |
| class OrganizationCreator |
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 optionSet = new OptionSet | |
| { | |
| {"p|password=", "The password for each certificate", x => password = x}, | |
| {"f|format=", "The string format for certificate names", x => format = x} | |
| }; | |
| var outputPath = optionSet.Parse(args).FirstOrDefault(); | |
| // Vessl e:\Export | |
| // Vessl --password=foobar e:\Export |
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
| GET /users | |
| Content-Type: application/json | |
| Link: rel=page2;href=/users?page=2 | |
| { | |
| page: 1, | |
| total: 1111002324, | |
| results: [ |
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.Collections.Generic; | |
| using System.Linq; | |
| namespace Other.Something.Core.Tasks | |
| { | |
| public static class DiffGenerator | |
| { | |
| public static Diff<T> Generate<T>(IEnumerable<T> left, IEnumerable<T> right) | |
| { | |
| var added = right.Except(left); |
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 DiffGenerator | |
| { | |
| public Diff<T> Generate<T>(IEnumerable<T> left, IEnumerable<T> right) | |
| { | |
| var added = right.Except(left).ToList(); | |
| var removed = left.Except(right).ToList(); | |
| var leftList = left.ToList(); | |
| var common = right.Where(item => leftList.Contains(item)).ToList(); |
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
| require File.expand_path(File.dirname(__FILE__) + '/edgecase') | |
| # Greed is a dice game where you roll up to five dice to accumulate | |
| # points. The following "score" function will be used calculate the | |
| # score of a single roll of the dice. | |
| # | |
| # A greed roll is scored as follows: | |
| # | |
| # * A set of three ones is 1000 points | |
| # |
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 PageTemplateManager : IPageTemplateManager | |
| { | |
| readonly IReadModelRepository readModelRepository; | |
| readonly object mutex; | |
| readonly IDictionary<Guid, IList<PageTemplate>> templates; | |
| public PageTemplateManager(IReadModelRepository readModelRepository) | |
| { | |
| this.readModelRepository = readModelRepository; | |
| this.templates = new Dictionary<Guid, IList<PageTemplate>>(); |
NewerOlder