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 TaskExecutor | |
{ | |
private ITaskProcessor _processor; | |
public TaskExecutor(ITaskProcessor processor) | |
{ | |
_processor = processor; | |
} | |
public void DoTask() | |
{ |
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
// Reusable Knockout ViewModel from WinRT object | |
// with two-way binding enabled. | |
(function () { | |
function camelCase(str) { | |
return str[0].toLowerCase() + str.substring(1); | |
} | |
function makeViewModel(obj) { | |
var vm = {}; | |
var properties = Object.keys(Object.getPrototypeOf(obj)); | |
properties.forEach(function (p) { |
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
if [ -n "$1" ]; then | |
file=$1 | |
else | |
file=( $(ls -xt *.sln | head -n1)) | |
fi | |
if [ -z "$file" ]; then | |
echo "No solution found." | |
exit 1 | |
fi | |
/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 11.0/Common7/IDE/devenv.exe "$file" & |
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
namespace MultipartSpike | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
public class MultipartParser | |
{ | |
private const int MaximumMemoryStreamSize = 1024*64; |
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
[UriTemplate("/accounts/profile/{Name}")] | |
[Canonical(typeof(ProfileViewModel))] // RESTful, baby! | |
public class GetProfile : IGet, IOutput<ProfileViewModel> | |
{ | |
private readonly UserReports _userReports; | |
private readonly ILogger _logger; | |
public GetProfile(UserReports userReports, ILogger logger) // No unnecessary injections | |
{ | |
_userReports = userReports; |
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
namespace Simple.NExtLib.Xml | |
{ | |
public class XmlAttributesAsDictionary | |
{ | |
private readonly XElement _element; | |
public XmlAttributesAsDictionary(XElement element) | |
{ | |
_element = element; | |
} |
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 Person | |
{ | |
public string Name { get; set; } | |
public List<string> Numbers { get; set; } | |
public static Person FromXml(XElement xml) | |
{ | |
return new Person | |
{ | |
Name = xml.Element("Name").MaybeValue(), |
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
<ItemGroup> | |
<TypeScriptCompile Include="$(ProjectDir)\**\*.ts" /> | |
</ItemGroup> | |
<Target Name="BeforeBuild"> | |
<Exec Command=""$(PROGRAMFILES)\Microsoft SDKs\TypeScript\0.8.0.0\tsc" -target ES5 @(TypeScriptCompile ->'"%(fullpath)"', ' ')" /> | |
</Target> |
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
declare interface AngularVersion { | |
full: string; | |
major: number; | |
minor: number; | |
dot: number; | |
codeName: string; | |
} | |
declare interface AngularModule { | |
requires: 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
static class DatabaseFactory | |
{ | |
public static IDatabase Create() | |
{ | |
Database.UseMockAdapter(CreateMockAdapter()); | |
// This single line of code applies all these interfaces | |
return Impromptu.ActLike<IDatabase>(Database.Open()); | |
} |