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 rules = new Dictionary<Func<int, bool>, Func<int, string>>(); | |
rules.Add(x => x % 3 == 0, x => "Fizz"); | |
rules.Add(x => x % 5 == 0, x => "Buzz"); | |
rules.Add(x => x % 15 != 0, x => x.ToString()); | |
rules.Add(x => true, x => "\n"); | |
var results = (from n in Enumerable.Range(1, 100) | |
from r in rules | |
where r.Key(n) |
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 MVC | |
{ | |
public static ActionResult Post(RequestContext context, string url, object thing) | |
{ | |
var controllerAndAction = url.Split('/'); | |
var controller = CreateController(context, controllerAndAction[0]); | |
var controllerContext = new ControllerContext(context, controller); | |
var controllerDescriptor = new ReflectedControllerDescriptor(controller.GetType()); |
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
<h2>Clients</h2> | |
<section> | |
<div id="alertClientCreated" class="alert alert-info" style="display: none;"> | |
Appointment Time: | |
<input type="text" id="dateWidget" /><br /> | |
<label id="dateWidgetValue" class="text-info"></label> | |
<button type="button" class="btn-info">Create Appointment!</button> | |
</div> | |
<a href="javascript:;" id="newClient">New Client</a> |
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
//here is a "familiar" test writen in NUnit. given that most developers | |
//are used to writing tests like this, | |
//you can see how different MSpec is | |
[TestFixture] | |
public class When_creating_a_new_account | |
{ | |
Account account = new Account(); | |
[Test] | |
public void Does_not_have_any_subscriptions() |
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.Text; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using UndeadEarth.Contract; | |
using UndeadEarth.Test.Dal.Utility; | |
using Moq; | |
using UndeadEarth.Dal; |
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
.getignore | |
# User-specific files | |
*.suo | |
*.user | |
# Build results | |
[Dd]ebug/ | |
[Rr]elease/ | |
x64/ |
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
{ | |
{ new Func<int, bool>(x => x % 3 == 0), new Func<int, string>(x => "Fizz") }, | |
{ new Func<int, bool>(x => x % 5 == 0), new Func<int, string>(x => "Buzz") }, | |
{ new Func<int, bool>(x => x % 3 != 0 && x % 5 != 0), new Func<int, string>(x => x.ToString()) }, | |
{ new Func<int, bool>( x => true), new Func<int, string>(x => "\n" ) } | |
}; | |
var output = from n in Enumerable.Range(1, 100) | |
from f in rules | |
where f.Key(n) |
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 static class Verify | |
{ | |
public static void NotEmpty(string value, string parameterName) | |
{ | |
if (value == string.Empty) | |
{ | |
throw new ArgumentEmptyException(parameterName); | |
} | |
} |
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
Start by pressing <esc>, that will put you in "command" mode. Now press "j". | |
See what happend? You're on this line now. "j" means down. Now press "5j". | |
if you see DASHED lines press "zR", otherwise ignore | |
if you see DASHED lines press "zR", otherwise ignore | |
What you did just there is "move down 5". Press "j" | |
If you mess your cursor position during this tutorial press "gg" to take you back to the top, try that now, next time press "j" | |
Time to follow the ascii road. press "j", then press the key that's highlighted by the blinking cursor | |
j <---- press "j" because j is curently under your cursor |
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
module database | |
open FSharp.Data.Sql | |
open FSharp.Data.Sql.Common | |
let [<Literal>] connectionString = "Data Source=.;Initial Catalog=CreditFulfillment;Integrated Security=SSPI;" | |
type sql = SqlDataProvider<DatabaseProviderTypes.MSSQLSERVER, | |
connectionString, | |
CaseSensitivityChange = CaseSensitivityChange.ORIGINAL> |
OlderNewer