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
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<ProvisioningJobDetailsViewModel>" %> | |
Here ya go son! |
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
// jQuery barfs because $(empty).data("autocomplete") => undefined | |
$(".course-autocomplete").autocomplete({ | |
source: "/courses/autocomplete.json" | |
}).data("autocomplete")._renderItem = function(ul, item) { | |
return $("<li>") | |
.data("item.autocomplete", item) | |
.append("<a>" + item.name + "</a>") | |
.appendTo(ul); | |
}; |
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
// jQuery barfs because $(empty).data("autocomplete") => undefined | |
$(".course-autocomplete").autocomplete({ | |
source: "/courses/autocomplete.json" | |
}).each(function(i,v){ | |
v.data("autocomplete")._renderItem = function(ul, item) { | |
return $("<li>") | |
.data("item.autocomplete", item) | |
.append("<a>" + item.name + "</a>") | |
.appendTo(ul); | |
}; |
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 ViewDataExtensions | |
{ | |
private static string Key<T>() { | |
return typeof (T).FullName; | |
} | |
public static T Get<T>(this ViewDataDictionary @this) { | |
var key = Key<T>(); | |
return (T) (@this.ContainsKey(key) ? @this[key] : default(T)); | |
} |
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
[When(@"I get the URL for the route")] | |
public void Given_I_get_the_URL_for_the_route() { | |
_path = LookupOutboundUrlFrom(_routeData, usingRoutes:MyRoutes(), whileRequestingUrl:_currentPage); | |
} | |
static string LookupOutboundUrlFrom( RouteValueDictionary givenRouteValues = null, | |
object givenRouteData = null, | |
RouteCollection usingRoutes = null, | |
string whileRequestingUrl = "~/", | |
string applicationPath = "/") |
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
<!-- you have to do this--> | |
<%= Html.ActionLink(job.CompanyName,"view","customer",new{id=job.CustomerId},new{}) %> | |
<!-- That's stupid. You have to have that empty anonymous object because in the other overload that | |
the route data would be the html attributes --> | |
<%= Html.ActionLink(job.CompanyName,"view","customer",new{ @class="link-class"}) %> | |
<!-- why don't we just do this --> |
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
Scenario: Supplying invalid data for a provisioning job | |
Given there is a form to collect provisioning information | |
When I consider a form to be valid | |
Then the following fields are required | |
| field | | |
| admin first name | | |
| admin last name | | |
| admin email address | | |
| url | | |
| server | |
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
var dateAsString = row["date completed"]; | |
DateTime cd; | |
var completedDate = DateTime.TryParse(dateAsString, out cd) ? cd : (DateTime?)null; |
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
<Project DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<Foo Condition="$(Foo)==''">bar</Foo> | |
</PropertyGroup> | |
<Target Name="Default"> | |
<Message Text="$(Foo)" /> | |
</Target> | |
</Project> |
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
# this is how it would be invoked as a new task in the rakefile | |
# you can override the hashing function or exclude/include files | |
revfiles :revfiles do |rev| | |
rev.files_to_rev << './**/*.bmp' | |
end |