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
//Sql CE - Database name will be set based on the DbContext inherited class | |
//If no App_Data folder exists you need to create it | |
Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0"); | |
//Uses default conn string but setting a connection string in config with the name of the context will override conn string | |
Database.DefaultConnectionFactory = new SqlConnectionFactory(); | |
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
@*Required variables, | |
Page - being the current page | |
PageCount - total pages | |
*@ | |
@if (PageCount > 0) | |
{ | |
var pagesEachWay = 2; | |
var pagesToShow = 5; |
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
.NamedColors(@name, @color) | |
{ | |
(~"body.@{name}") { | |
h1{ | |
color: @color; | |
} | |
} | |
(~"li.@{name}"){ | |
a{ | |
background-image: ~'url("/media/@{name}_triangle.png")'; |
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 ActionResult Index() | |
{ | |
ViewBag.Data = new Bortosky.Google.Visualization.GoogleDataTable(ExampleTable()).GetJson(); | |
return View(); | |
} | |
private static DataTable ExampleTable() | |
{ | |
var dt = new DataTable(); |
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
:after in IE7 | |
#content blockquote:after, | |
#content blockquote .after { | |
background:url('/images/background/_sprite.png'); | |
background-position:-259px -66px; | |
bottom:26px; | |
content:''; | |
display:block; | |
height:14px; |
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
<script> | |
$(function() { | |
$('a.more').click(function(e) { | |
e.preventDefault(); | |
var url = $(this).attr('href'); | |
//Show loading symbol | |
$('.loader').show(); | |
$.get(url, function(data) { | |
var $data = $(data); |
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
/*sprite bg*/ | |
background:url('../images/background/_sprite.png') no-repeat 0px 0px; | |
/*border radius - each side*/ | |
-webkit-border-radius: 5px 5px 5px 5px; | |
border-radius: 5px 5px 5px 5px; | |
/*border radius - equal sides*/ | |
-webkit-border-radius: 5px; | |
border-radius: 5px; |
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
/* Faster get element by ID */ | |
var a = $(document.getElementById("elementID")); | |
/* Email address regex */ | |
^([\w-]+\.)*?[\w-]+@[\w-]+\.([\w-]+\.)*?[\w]+$ |
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
/* Disqus load comments */ | |
$('#load-comments').on('click', function (e) { | |
e.preventDefault(); | |
var loadBtn = $(this); | |
if (!loadBtn.hasClass('disabled')) { | |
loadBtn.addClass('disabled'); | |
//Remove any old errors | |
$("#content").find('.comments_error').remove(); |
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
/* Basic equals expression */ | |
//Line by line | |
ParameterExpression pe = Expression.Parameter(typeof(Object), "x"); | |
Expression left = Expression.Property(pe, typeof(Object).GetProperty("PropertyName")); | |
Expression right = Expression.Constant("value"); | |
Expression expression = Expression.Equal(left, right); | |
var lambda = Expression.Lambda<Func<Object, bool>>(expression, pe); | |
// Short hand |
OlderNewer