Skip to content

Instantly share code, notes, and snippets.

View rhullah's full-sized avatar

Ryan Hullah rhullah

View GitHub Profile
@rhullah
rhullah / MyScheduledTask.cs
Created July 12, 2018 16:28
This is an example of a sample task that reschedules itself, thus creating a recurring task. This is initially kicked off in the Global.asax/Bootstrap section calling MyScheduledTask.ScheduleTask(true).
public class MyScheduledTask : ScheduledTask
{
public static readonly string MyKey = "<hard coded guid string>";
public MyScheduledTask()
{
Key = MyKey;
}
@rhullah
rhullah / Mvc\Scripts\ImagePicker\designerview-simple.js
Last active September 6, 2017 14:49
Multiple Image picker with Sorting
angular.module('designer').requires.push('sfImageSelector', 'sfSelectors', 'ngSanitize');
angular.module('designer').controller('SimpleCtrl', [
'$scope',
function ($scope) {
// This (or some representation of it) is what you'd save back to the Properties (Controller)
$scope.selectedImages = [];
$scope.picker = {
@rhullah
rhullah / CustomLuceneSearchService.cs
Created March 25, 2016 13:41
Overriding Sitefinity's Lucene Search Service
// Example of custom Search Service that can add boosting
public class DaytonLuceneSearchService : LuceneSearchService
{
private static readonly Regex LuceneEscape = new Regex(@"(\+|-|&&|\|\||!|\(|\)|\{|\}|\[|\]|\^|""|~|\*|\?|:|\\)", RegexOptions.Compiled);
protected override string BuildQuery(ISearchQuery input)
{
input.Text = LuceneEscape.Replace(input.Text, match => @"\\" + match.Captures[0].Value);
string baseQuery = base.BuildQuery(input);