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
<html> | |
<body> | |
<form data-bind="submit: onSubmit"> | |
<button type="submit">Submit</button> | |
</form> | |
<script type="text/javascript" src="knockout-2.0.0.js"></script> | |
<script type="text/javascript"> | |
window.onload = function () { |
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
Feature("Character management", module) | |
.scenario("Create a new character") | |
.given(Events.Named_AreSubscribedTo "characterCreated") | |
.when(Character._IsCreatedWithName_ 1, 'bob') | |
.then(Events.ShouldDescribeTheCreationOfCharacter_Named_ 1, 'bob') | |
.complete() |
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
{Feature} = require "vows-bdd" | |
vows = require 'vows' | |
assert = require 'assert' | |
Feature("Share stuff between steps", module) | |
.scenario("Set properties on given and when") | |
.given "A is set", -> | |
@A = "A" | |
@callback() |
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
Import-Module pswatch | |
Function Rebuild($message) | |
{ | |
cls | |
Write-Host $message | |
Invoke-psake .\build.ps1 | |
} | |
Rebuild "Starting up." |
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 TypedFactoryTests | |
{ | |
#region Using Directives | |
using Castle.Facilities.TypedFactory; | |
using Castle.MicroKernel.Registration; | |
using Castle.Windsor; | |
using Should.Fluent; |
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
# watch a file changes in the current directory, | |
# compile when a .coffee file is changed or renamed | |
$watcher = New-Object System.IO.FileSystemWatcher | |
$watcher.Path = get-location | |
$watcher.IncludeSubdirectories = $true | |
$watcher.EnableRaisingEvents = $false | |
$watcher.NotifyFilter = [System.IO.NotifyFilters]::LastWrite -bor [System.IO.NotifyFilters]::FileName | |
while($TRUE){ |
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
class Player | |
play: (song) -> | |
@currentlyPlayingSong = song | |
@isPlaying = true | |
pause: -> | |
@isPlaying = false | |
resume: -> | |
throw new Error "song is already playing" if this.isPlaying |
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
# Tools | |
.\NuGet.exe i DotCover -s \\myserver\Dev\NuGetPackages -o Tools | |
.\NuGet.exe i StyleCopCmd -s \\myserver\Dev\NuGetPackages -o Tools | |
# Dependecies | |
$packageConfigs = Get-ChildItem . -Recurse | where{$_.Name -eq "packages.config"} | |
foreach($packageConfig in $packageConfigs){ | |
Write-Host "Restoring" $packageConfig.FullName | |
nuget i $packageConfig.FullName -o Packages | |
} |
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 static class RequestExtensions | |
{ | |
public static string AsString(this RequestStream requestStream) | |
{ | |
return new StreamReader(requestStream).ReadToEnd(); | |
} | |
public static XDocument AsXml(this RequestStream requestStream) | |
{ | |
return XDocument.Load(requestStream); |
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
Comma and semicolon | |
Use the comma (,) and semi-colon (;) characters to indicate nonhierarchical portions | |
of the URI. The semicolon convention is used to identify matrix parameters: | |
http://www.example.org/co-ordinates;w=39.001409,z=-84.578201 | |
http://www.example.org/axis;x=0,y=9 | |
These characters are valid in the path and query portions of URIs, but not all code | |
libraries recognize the comma and semicolon as separators and may require custom |