Skip to content

Instantly share code, notes, and snippets.

@arafalov
arafalov / gist:2889393
Created June 7, 2012 15:24
Using LINQ to bulk extract Kentico's templates and documents/pages that use them
// Using Kentico site export, find all templates and associated Documents/pages, skip templates that are not used
// Uses LINQPad's C# Statements format
//Root directory where the unzipped Kentico export file sit (with Data subdirectory)
string exportDirPath = @"<UNZIPPED_FULL_SITE_EXPORT>\Data";
//XML files for documents and templates definitions
XDocument docSource = XDocument.Load(exportDirPath + @"\Documents\cms_document.xml.export");
XDocument templateSource = XDocument.Load(exportDirPath + @"\Objects\cms_pagetemplate.xml.export");
@arafalov
arafalov / gist:2930773
Created June 14, 2012 14:45
Using Kentico site export, find all templates that include DocumentDataSource with path expressions pointing to other documents (which will break when document tree moves)
// Using Kentico site export, find all templates that include DocumentDataSource with path expressions pointing to other documents (which will break when document tree moves)
// Uses LINQPad's C# Statements format
//Root directory where the unzipped Kentico export file sit (with Data subdirectory)
string exportDirPath = @"<UNZIPPED_FULL_SITE_EXPORT>\Data";
//XML files for documents and templates definitions
XDocument templateSource = XDocument.Load(exportDirPath + @"\Objects\cms_pagetemplate.xml.export");
XDocument siteTemplateSource = XDocument.Load(exportDirPath + @"\Site\cms_pagetemplate.xml.export");
@arafalov
arafalov / gist:2938303
Created June 15, 2012 19:22
Using Kentico site export, find all Document Aliases that have culture assigned and may not survive culture change
// Using Kentico site export, find all Document Aliases that have culture assigned and may not survive culture change
// Uses LINQPad's C# Statements format
//Root directory where the unzipped Kentico export file sit (with Data subdirectory)
string exportDirPath = @"<UNZIPPED_FULL_SITE_EXPORT>\Data";
//XML files for documents and templates definitions
XDocument docSource = XDocument.Load(exportDirPath + @"\Documents\cms_document.xml.export");
@arafalov
arafalov / test.rb
Created June 18, 2014 05:46
rsolr basic example
require 'rubygems'
require 'rsolr'
# 1. Connect to an empty example collection
solr = RSolr.connect :url => 'http://localhost:8983/solr'
puts('Before anything')
puts(solr.get 'select', :params => {:q => '*:*'})
<!--
From switch documentation: 'default' and 'case' are different things and cover different situations.
'default' covers any value being present and
'case' covers missing/empty value.
-->
<requestHandler name="/advanced" class="solr.SearchHandler">
<lst name="defaults">
<str name="rows">100</str>
</lst>
<lst name="invariants">
package com.solrstart;
import org.attoparser.IMarkupHandler;
import org.attoparser.IMarkupParser;
import org.attoparser.MarkupParser;
import org.attoparser.ParseException;
import org.attoparser.config.ParseConfiguration;
import org.attoparser.discard.DiscardMarkupHandler;
import org.attoparser.select.NodeSelectorMarkupHandler;
import org.attoparser.simple.AbstractSimpleMarkupHandler;