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 static string ToBindingTypeName(this string bindingName) | |
{ | |
var firstChar = new string(new[] {bindingName.First()}).ToUpper(); | |
return firstChar + new string(bindingName.Skip(1).ToArray()); | |
} |
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
[TestCase("/categoryName/itemname", "/sitebaseaddress/hub/categoryName.aspx")] | |
public void GetDestinationUrl_ValidUrls_ReturnsCorrectDestionation(string url, string expected) | |
{ | |
var cacheHandler = new Mock<IMappingCacheHandler>(); | |
var httpContext = new Mock<IHttpContextFacade>(); | |
var target = new DataMap(null, cacheHandler.Object, httpContext.Object); | |
var mappings = new List<Data>(); | |
string baseUrl = "/sitebaseaddress/"; | |
cacheHandler.Setup(ch => ch.Load<Data>()).Returns(mappings); | |
cacheHandler.Setup(ch => ch.Save(It.IsAny<List<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
[TestFixture] | |
public class SomeTests{ | |
[Test] | |
public void SimpleSingleItemDecodeTest() | |
{ | |
var xml = " <subscription-plan>" | |
+ " <name>Plan 3</name>" | |
+ " <id type=\"integer\">3</id>" | |
+ " </subscription-plan>"; |
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
namespace JsonFx.Xml | |
{ | |
using System.Xml.Serialization; | |
using Resolvers; | |
using Serialization; | |
using Xunit; | |
public class XmlReaderTests | |
{ | |
public class Person |
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 static SomeEntity Get(string someEntityIdentifier) | |
{ | |
return Cache.Get(string.Format("MyCacheKey_{0}", someEntityIdentifier), CacheFrequency.Daily, () => | |
{ | |
Entity result = null; | |
DataManager.ReadFromStoredProcedure("some_entity_fetching_stored_proc", new Dictionary<string, object> | |
{ | |
{"@id", someEntityIdentifier }, | |
}, reader => |
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
exec sp_executesql N'SELECT | |
CASE WHEN ([UnionAll26].[C76] = 1) THEN ''1X0X'' WHEN ([UnionAll26].[C77] = 1) THEN ''1X1X'' WHEN ([UnionAll26].[C78] = 1) THEN ''1X2X'' WHEN ([UnionAll26].[C79] = 1) THEN ''1X3X'' WHEN ([UnionAll26].[C92] = 1) THEN ''1X4X'' WHEN ([UnionAll26].[C80] = 1) THEN ''1X5X'' WHEN ([UnionAll26].[C81] = 1) THEN ''1X6X'' WHEN ([UnionAll26].[C73] = 1) THEN ''1X7X'' WHEN ([UnionAll26].[C98] = 1) THEN ''1X8X'' WHEN ([UnionAll26].[C82] = 1) THEN ''1X9X'' WHEN ([UnionAll26].[C99] = 1) THEN ''1X10X'' WHEN ([UnionAll26].[C93] = 1) THEN ''1X11X'' WHEN ([UnionAll26].[C83] = 1) THEN ''1X12X'' WHEN ([UnionAll26].[C84] = 1) THEN ''1X13X'' WHEN ([UnionAll26].[C85] = 1) THEN ''1X14X'' WHEN ([UnionAll26].[C86] = 1) THEN ''1X15X'' WHEN ([UnionAll26].[C87] = 1) THEN ''1X16X'' WHEN ([UnionAll26].[C88] = 1) THEN ''1X17X'' WHEN ([UnionAll26].[C94] = 1) THEN ''1X18X'' WHEN ([UnionAll26].[C74] = 1) THEN ''1X19X'' WHEN ([UnionAll26].[C75] = 1) THEN ''1X20X'' WHEN ([UnionAll26].[C89] = 1) THEN ''1X21X'' WHEN ([Uni |
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
PS C:\Program Files\Console2> $global:fred = Set-PSBreakpoint -Variable fred -Mode read -Action { $global:fred = Get-Date } | |
PS C:\Program Files\Console2> $fred | |
31 October 2011 18:42:59 | |
PS C:\Program Files\Console2> $fred | |
31 October 2011 18:43:01 |
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
var toSearchForm = searchTerm.Split(' '); | |
var searcher = ExamineManager.Instance.SearchProviderCollection["SiteQuickSearchSearcher"]; | |
var criteria = searcher.CreateSearchCriteria(IndexTypes.Content); | |
var fieldsToSearch = new[] | |
{ | |
"nodeName", "pageTitle", "menuText", "pageBody", "metaKeywords", | |
"metaDescription" | |
}; |
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
#!/bin/bash | |
usage() | |
{ | |
echo "Usage: $0 <svn_url> <git_url> <svn_authorsfile> [--branches]" | |
exit 1 | |
} | |
create_svn_fetch_dir() | |
{ |
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
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | |
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=5F96955EB47AE94FA37A304345ABFE15/@KeyIndexDefined">True</s:Boolean> | |
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=5F96955EB47AE94FA37A304345ABFE15/Description/@EntryValue">Nancy Module</s:String> | |
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=5F96955EB47AE94FA37A304345ABFE15/Text/@EntryValue">
 | |
namespace $NAMESPACE$
 | |
{
 | |
using Nancy;
 | |

 | |
public class $NEW_MODULE$ : NancyModule
 | |
{
 |
OlderNewer