I love this quote by Mat Marquis from TXJS 2015:
We, as an industry, have nearly decided that we are all doing a really, really good job as long as we don't count the instances where we're doing a really, really bad job.
void Main() | |
{ | |
var order = new Order | |
{ | |
Instructions = SpecialInstructions.LeaveAtDoor, | |
}; | |
var thing = new Thing | |
{ | |
Instructions = order.Instructions, |
begin transaction | |
create table DumbSample ( | |
Expired bit default 0, | |
Name varchar(max) | |
) | |
insert into DumbSample (Expired, Name) values (0, 'Milk'); |
public class CommandResolutionTests | |
{ | |
public void should_resolve_text_to_command() | |
{ | |
"samplecommand".Called<SampleCommand>(); | |
} | |
public void should_call_command_hello() | |
{ | |
"samplecommand hello".Called<SampleCommand>() |
I love this quote by Mat Marquis from TXJS 2015:
We, as an industry, have nearly decided that we are all doing a really, really good job as long as we don't count the instances where we're doing a really, really bad job.
[DebuggerStepThrough] | |
public static void ForEach<T>(this IEnumerable<T> items, Action<T> processor) | |
{ | |
foreach (var item in items) | |
{ | |
processor(item); | |
} | |
} |
namespace CRIneta.Web.Core.Domain | |
{ | |
public class Attendee | |
{ | |
protected readonly string email; | |
protected readonly Meeting meeting; | |
protected readonly int attendeeId; | |
protected Attendee() | |
{ |
public static Int32 GetChainLength(Int32 value) | |
{ | |
Func<Int32, Int32> a = n => n / 2; | |
Func<Int32, Int32> b = n => 3 * n + 1; | |
Int32 chainLength = 1; | |
Int32 x = value; | |
while(x > 1) | |
{ | |
x = (x > 1 && x % 2 == 0) ? a(x) : b(x); |
function createMenu(desk) { | |
var createMenuItem = function(text, className) { | |
return $("<div/>").html(text).addClass("clickable").addClass(className).hide(); | |
}; | |
desk.append(createMenuItem('Trouble', 'troubleFlag')); | |
desk.append(createMenuItem('Leader', 'leaderFlag')); | |
} |
// One of the reasons I like JavaScript: | |
function toggleTrait(trait, iconName) { | |
// some ugly code :) | |
((hasTrait) ? addIcon : removeIcon)(iconBar, iconName); | |
} | |
function addIcon(iconBar, iconName) { | |
iconBar.append($("<img/>").attr("src", "img/" + iconName + ".png")); | |
} | |
function removeIcon(iconBar, iconName) { |
public static class IoC | |
{ | |
private static readonly Container container; | |
static IoC() | |
{ | |
container = new Container(x => | |
{ | |
x.ForConcreteType<OrderFilter>() | |
.Configure.WithCtorArg("connectionString") |