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
defmodule Checkout do | |
defstruct [ | |
basket: %{A: 0, B: 0, C: 0, D: 0} | |
] | |
def scan(checkout, code) do | |
new_value = checkout.basket[code] + 1 | |
%{checkout | basket: Map.put(checkout.basket, code, new_value)} | |
end |
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.Collections.Generic; | |
using System.Linq; | |
namespace CodeReviewExercise | |
{ | |
using System; | |
using Serilog; | |
public class Customer | |
{ |
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
var PayTable = React.createClass({ | |
getInitialState: function() { | |
return { | |
sortDirection: 'descending', | |
data: this.props.payYears.sort(sortDescending) | |
}; | |
}, | |
sortData: function() { | |
if(this.state.sortDirection==='descending') { | |
this.setState({ |
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; | |
using ClassOrStruct; | |
namespace Runner | |
{ | |
class Program | |
{ | |
private static readonly Random Random = new Random(); | |
private const int Capacity = 25000000; |
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
'use strict'; | |
var less=require('less'); | |
var fs = require('fs'); | |
var getTree = function(filePath, callback) { | |
var parser = new(less.Parser)(); | |
fs.readFile(filePath, function (err, data) { | |
if (err) callback(err); |
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
Image resizer diagnostic sheet 14/08/2013 12:19:32 | |
2 Issues detected: | |
(Warning): To potentially see additional errors here, perform an image resize request. | |
(Warning): NoCache is only for development usage, and cannot scale to production use. | |
Add DiskCache or CloudFront for production use |
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; | |
using System.Linq; | |
using System.Reflection; | |
using Raven.Client; | |
using Raven.Client.Embedded; | |
using Raven.Client.Indexes; | |
using Raven.Client.Listeners; | |
using Xunit; |
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
[HttpPost] | |
public ActionResult Register(RegisterModel model) | |
{ | |
if (ModelState.IsValid) | |
{ | |
// Attempt to register the user | |
MembershipCreateStatus createStatus; | |
Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, null, out createStatus); | |
if (createStatus == MembershipCreateStatus.Success) |
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
public class RegisterModel | |
{ | |
[Required] | |
[Display(Name = "User name")] | |
public string UserName { get; set; } | |
[Required] | |
[DataType(DataType.EmailAddress)] | |
[Display(Name = "Email address")] | |
public string Email { get; set; } |
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
<profile defaultprovider="DefaultProfileProvider" inherits="AcrHack.Models.CustomProfile"/> |