Skip to content

Instantly share code, notes, and snippets.

View twiernik's full-sized avatar

Tomek Wiernik twiernik

  • GFT
  • Poznań
View GitHub Profile
<img class="cq-placeholder-image" src="/libs/cq/ui/widgets/themes/default/placeholders/text.png">
@twiernik
twiernik / AssetConfigurationReader.cs
Created October 19, 2018 19:00
AssetConfigurationReader
public class AssetConfigurationReader : Sitecore.XA.Foundation.Theming.Configuration.AssetConfigurationReader
{
public static AssetConfiguration Read()
{
return new AssetConfigurationReader().ReadConfiguration();
}
public override AssetConfiguration ReadConfiguration()
{
@twiernik
twiernik / gist:94d231f804674b79400cc1ab28458592
Created February 23, 2018 08:14
Delete bin and obj folders
Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
@twiernik
twiernik / ResouceLoader.cs
Created June 21, 2016 05:31
Resource loader
/// <summary>
/// Helper class providing methods to load application resource files.
/// </summary>
public static class ResourceFileLoader
{
/// <summary>
/// Loads file from resources and creates XDocument from its content.
/// </summary>
/// <param name="namespacePath">assembly root namespace plus path to
/// resource folder within directory structure (eg. <c>Forcom.Perspectiv.Server</c>
var node = new ConditionNode
{
LhsOperand = new PropertyOperand
{
OperandDescription = new PropertyDescription(TypeId.GetTypeId<DateTime>(),
new LocalizableString { ResourceKey = PromotionSharedStrings.ResourceNames.ReportPromotionDateTo },
new NHibernateMetadata
{
FieldName = "rp.DateTo",
RequiredJoins = new string[0],