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
-- Instructions -- | |
-- Create the dummy hardware in Domoticz if you haven't already and from there, | |
-- create two 'Custom Sensor' devices with the axis labels 'EUR/kWh' and 'EUR/m³'. | |
-- Then set the following two device ids: | |
local powerDeviceIdx = 222 | |
local gasDeviceIdx = 223 | |
return { | |
on = { |
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> | |
/// Replaces the <see cref="regexEscapedSearch" /> occurrences with <see cref="oddReplace" /> and <see cref="evenReplace"/> | |
/// </summary> | |
/// <param name="input">The input string</param> | |
/// <param name="regexEscapedSearch">The string to search for (escaped for usage in regex)</param> | |
/// <param name="oddReplace">To replace odd occurrences with</param> | |
/// <param name="evenReplace">To replace even occurrences with</param> | |
/// <returns></returns> | |
public static string ReplaceOddEvenOccurrences(this string input, string regexEscapedSearch, string oddReplace, string evenReplace) | |
{ |
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
--deletes in Document | |
--at this point all associated media files are deleted | |
delete from umbracoDomains where id in (select id from umbracoNode where path like '%-20%' and id!=-20); | |
delete from cmsDocument where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20); | |
--deletes in Content | |
delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where path like '%-20%' and id!=-20); | |
delete from cmsPreviewXml where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20); | |
delete from cmsContentVersion where ContentId in (select id from umbracoNode where path like '%-20%' and id!=-20); | |
delete from cmsContentXml where NodeId in (select id from umbracoNode where path like '%-20%' and id!=-20); |
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
MediaFileSystem mediaFileSystem = FileSystemProviderManager.Current.GetFileSystemProvider<MediaFileSystem>(); | |
IContentSection contentSection = UmbracoConfig.For.UmbracoSettings().Content; | |
IEnumerable<string> supportedTypes = contentSection.ImageFileTypes.ToList(); | |
foreach (IMedia media in e.SavedEntities) | |
{ | |
if (media.HasProperty("umbracoFile")) | |
{ | |
// Make sure it's an image. | |
string path = media.GetValue<string>("umbracoFile"); |
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
<!-- SEO rules (from: http://www.seomoz.org/blog/what-every-seo-should-know-about-iis#chaining) --> | |
<!-- SEO | Section 1 | Whitelist --> | |
<rule name="Whitelist - Resources" stopProcessing="true"> | |
<match url="^(?:css/|scripts/|images/|install/|config/|umbraco/|umbraco_client/|base/|webresource\.axd|scriptresource\.axd|__browserLink|[^/]*/arterySignalR/.*)" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" /> | |
<action type="None" /> | |
</rule> | |
<!-- SEO | Section 2 | Rewrites (chaining) --> | |
<rule name="SEO - Remove default.aspx" stopProcessing="false"> | |
<match url="(.*?)/?default\.aspx$" /> |