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
using System; | |
using System.Text; | |
public static class ExtensionMethods | |
{ | |
/// <summary> | |
/// Case insensitive string replacement | |
/// </summary> | |
/// <param name="str">string to process</param> | |
/// <param name="oldValue">old value to find</param> |
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
string s = string.Join(",", myDict.Select(x => x.Key + "=" + x.Value).ToArray()); |
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 for SelectTopNRows command from SSMS ******/ | |
SELECT * | |
FROM [dbo].[cmsMacro] | |
WHERE macroRefreshRate > 0 |
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 for SelectTopNRows command from SSMS ******/ | |
SELECT | |
macro AS 'ID', | |
macroName AS 'Name', | |
macroPropertyAlias AS 'Alias', | |
macroRefreshRate AS 'Timeout' | |
FROM [dbo].[cmsMacroProperty] AS table1 | |
LEFT OUTER JOIN [dbo].[cmsMacro] AS table2 | |
ON table1.macro = table2.id |
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
Get-WmiObject -Class Win32_Product | Select-Object -Property Name |
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
/// <summary> | |
/// Helper class for accesing configuration file | |
/// </summary> | |
public class ConfigurationHelper | |
{ | |
/// <summary> | |
/// Returns strongly typed application setting value | |
/// </summary> | |
/// <typeparam name="T">Entry type</typeparam> | |
/// <param name="key">configuraiton key</param> |
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 static T ParseEnum<T>( string value ) | |
{ | |
return (T) Enum.Parse( typeof( T ), value, true ); | |
} |
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
In the days of .NET 1.1, this gave sites JavaScript support. Safe to delete on most websites. |
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
(Get-Content test.txt) | ForEach-Object { $_ -replace "foo", "bar" } | Set-Content test.txt |
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
UmbracoHelper Help = new UmbracoHelper(UmbracoContext.Current); | |
IEnumerable Item = Help.TypedContent(JsonId.ToString().Split(',')).OfType(); |