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
// Calling a WCF Data Service with jQuery | |
// | |
// This will generate a URL like this... | |
// http://example.com/Products.svc/Customers(1234)/Orders?$skip=10&top=10 | |
// ... and pass the JSON data result to your callback function | |
$.fromServiceUrl("http://example.com/Products.svc") | |
.queryTable("Customers", 1234) | |
.withRelation("Orders") | |
.skip(10) |
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
// Example 1 | |
var query = from item _dataContext.PublishedItems | |
select item; | |
// When enumerated (i.e. looped) over, "query" will go to the DB, and get all items | |
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
// Jasmine | |
// http://pivotal.github.com/jasmine/ | |
describe("Calculator", function() { | |
it("should add two numbers correctly", function() { | |
var result = add(3, 4); | |
expect(result).toEqual(7); | |
}); | |
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
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace RefactoringNeeded | |
{ | |
#region Alert filter | |
public static class AlertFilter | |
{ |
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
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace RefactoringNeeded | |
{ | |
#region Alert filter | |
public static class AlertFilter | |
{ |
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
// Unformatted / unindented | |
new Nullable<decimal>().GetValueOrDefault().GetType().GetMethod("Parse", BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(string) }, null).Invoke(null, new object[] { "123,45" }) | |
// Formatted / indented | |
new Nullable<decimal>().GetValueOrDefault() | |
.GetType() | |
.GetMethod("Parse", | |
BindingFlags.Static | BindingFlags.Public, | |
null, | |
new Type[] { typeof(string) }, |
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
using System; | |
using NUnit.Framework; | |
namespace MvcBlogEngine.Tests.Controllers | |
{ | |
public partial class WidgetControllerSpec | |
{ | |
[TestFixture] | |
public partial class TagCloud : BDDTest | |
{ |
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
prepareSnacks({ | |
'biscuits': "Hobnobs", | |
'crisps': "Quavers", | |
'peanuts': "Lots and lots!", | |
'olives': "The ones with feta cheese inside", | |
// etc etc | |
}); |
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
using System; | |
using System.Web; | |
public class MyJsonHttpHandler : IHttpHandler | |
{ | |
public bool IsReusable | |
{ | |
get { return false; } | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
using MonoTouch.ObjCRuntime; | |
namespace CustomTableCellApp | |
{ | |
public class TableCellFactory<T> where T : UITableViewCell |
OlderNewer