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
| // Arrange | |
| // Act | |
| // Assert | |
| Naming convention |
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
| <ul> | |
| <li ng-repeat="(key, errors) in editForm.$error track by $index"> <strong>{{ key }}</strong> errors | |
| <ul> | |
| <li ng-repeat="e in errors">{{ e.$name }} has an error: <strong>{{ key }}</strong>.</li> | |
| </ul> | |
| </li> | |
| </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
| /* 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 |
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
| /* 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 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
| /* Faster get element by ID */ | |
| var a = $(document.getElementById("elementID")); | |
| /* Email address regex */ | |
| ^([\w-]+\.)*?[\w-]+@[\w-]+\.([\w-]+\.)*?[\w]+$ |
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
| /*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 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
| <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 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
| :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 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 ActionResult Index() | |
| { | |
| ViewBag.Data = new Bortosky.Google.Visualization.GoogleDataTable(ExampleTable()).GetJson(); | |
| return View(); | |
| } | |
| private static DataTable ExampleTable() | |
| { | |
| var dt = new DataTable(); |
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
| .NamedColors(@name, @color) | |
| { | |
| (~"body.@{name}") { | |
| h1{ | |
| color: @color; | |
| } | |
| } | |
| (~"li.@{name}"){ | |
| a{ | |
| background-image: ~'url("/media/@{name}_triangle.png")'; |