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
type VersionNumber = | |
| Major of major: int | |
| Minor of major: int * minor: int | |
| Patch of major: int * minor: int * patch: int | |
type Version = | |
| Release of VersionNumber | |
| PreRelease of VersionNumber * string | |
static member create (x) = Release (Major x) |
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
package demo | |
object ScalaDsl { | |
/* | |
* Defining a simplistic model for the web app DSL | |
*/ | |
case class HttpRequest(path: String, headers: Map[String, String], body: Option[String]) |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.shishkin</groupId> | |
<artifactId>testing-examples</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<name>${project.artifactId}</name> | |
<prerequisites> |
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
resolve-path *.pdb | % { | |
$pdb = $_ | |
$fileName = split-path $pdb -leaf | |
$assembly = [io.path]::GetFileNameWithoutExtension($fileName) | |
$gac = "$env:windir\assembly\GAC_MSIL\$assembly" | |
if (test-path $gac) { | |
resolve-path "$gac\*" | % { | |
copy $pdb -destination $_ -force | |
} | |
} |
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
namespace FunctionalCSharp | |
{ | |
using System; | |
using Shouldly; | |
using Xunit; | |
public class Tests | |
{ |
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
$(function(){ | |
$('<pre id="results"></pre>').appendTo('body'); | |
window.log = function(msg) { | |
if (typeof msg !== 'string') { | |
msg = JSON.stringify(msg, null, 2); | |
} | |
$('#results').append(msg + '\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
{ | |
"order": { | |
"href": "http://...", | |
"method": "POST", | |
"template": { | |
"location": "", | |
"@location": { | |
"prompt": "Enter your postal code" | |
}, | |
"pickupTime": "", |
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
{ | |
"@": { | |
"id": "http://example.org/my-obj", | |
"description": "This object is described with an embedded descriptor. Other JSON-Schema properties may follow." | |
}, | |
"prop": "value" | |
} |
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
import scala.annotation.tailrec | |
def sum(nums: Seq[Int]) = fold(0)(nums, _ + _) | |
def filterEven(nums: Seq[Int]): Seq[Int] = filter(nums, _ % 2 == 0) | |
def filter(nums: Seq[Int], predicate: Int => Boolean): Seq[Int] = | |
fold(List[Int]())(nums, (l, i) => if (predicate(i)) l :+ i else l) | |
def square(nums: Seq[Int]): Seq[Int] = map(nums, i => i * i) |
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
[ | |
{ | |
"title": "Far future", | |
"startsAt": "2013-01-01 00:00:00Z", | |
"accept": "http://...", | |
"decline": "http://..." | |
},{ | |
"title": "Near future", | |
"startsAt": "2012-09-01 00:00:00Z", | |
"rsvp_status": "accepted", |
OlderNewer