Skip to content

Instantly share code, notes, and snippets.

@caedmonjudd
caedmonjudd / rails.html
Created December 1, 2016 20:08
Side rail updates
<script>
googletag.cmd.push(function() {
var bannerMapping = googletag.sizeMapping().
addSize([1050, 500], [[970, 120], [970, 90], [728, 90]]).
addSize([320, 400], [[320,50], [320, 100]]). //iphone 4 etc
addSize([550, 300], [[320, 50], [320, 100]]). //iphone 6 plus etc
addSize([600, 250], [[320, 50], [320, 100]]). //droid turbo, nexus 6 etc
build();
@caedmonjudd
caedmonjudd / mvc3-model-validation.cs
Last active June 8, 2016 20:12
MVC3 Model Validatation - Extract Errors
foreach (ModelState modelState in ViewData.ModelState.Values)
{
foreach (ModelError error in modelState.Errors)
{
ModelState.AddModelError("Name", error.ErrorMessage);
}
}