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.Linq; | |
using Umbraco.Core.Composing; | |
using Umbraco.Core.Events; | |
using Umbraco.Core.Models; | |
using Umbraco.Core.Persistence.Repositories; | |
using Umbraco.Core.Services; | |
using Umbraco.Core.Services.Implement; | |
namespace Adventure.Core | |
{ |
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 class WhitespaceModule : IHttpModule | |
{ | |
public void Dispose() { } | |
public void Init(HttpApplication context) | |
{ | |
context.BeginRequest += Context_BeginRequest; | |
} | |
private void Context_BeginRequest(object sender, EventArgs e) |
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 class WhitespaceFilter : Stream | |
{ | |
public WhitespaceFilter(Stream sink) => _sink = sink; | |
private Stream _sink; | |
private static readonly Regex reg = new Regex(@"(?<=[^])\t{2,}|(?<=[>])\s{2,}(?=[<])|(?<=[>])\s{2,11}(?=[<])|(?=[\n])\s{2,}"); | |
public override bool CanRead => true; | |
public override bool CanSeek => 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
from argparse import ArgumentParser | |
from random import sample | |
def generate(amount_of_teams, names): | |
amount_of_names = len(names) | |
while amount_of_names > 0 and amount_of_teams > 0: | |
team = sample(names, int(amount_of_names/amount_of_teams)) | |
for name in team: | |
names.remove(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
attribute disk clear readonly |
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.Security.Cryptography; | |
using System.Text; | |
namespace Security | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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 ContentModels = Umbraco.Web.PublishedModels; | |
var post = blog.Value<IPublishedContent>(ContentModels.Blog.GetModelPropertyType(x => x.Featured).Alias, "en-US"); |
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 class ProductComponent : IComponent | |
{ | |
private readonly IExamineManager _examineManager; | |
private readonly ProductIndexCreator _productIndexCreator; | |
public ProductComponent (IExamineManager examineManager, ProductIndexCreator productIndexCreator) | |
{ | |
_examineManager = examineManager; | |
_productIndexCreator = productIndexCreator; | |
} |
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 PagedResult<BlogPost> GetPagedPostsForDisplay(int page, int max, int featured) | |
{ | |
var results = _blogSearcher.CreateQuery() | |
.NodeTypeAlias(BlogPost.ModelTypeAlias) | |
.Not() | |
.Id(featured) | |
.Not() | |
.Field(Constants.Properties.Hidden, "1") | |
.OrderByDescending(new SortableField(Constants.Examine.PublishedAt)) | |
.Execute(Paging.Max(page, max)); |
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
<IndexSet SetName="ukTownsIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/uktowns/"> | |
<IndexUserFields> | |
<add Name="name" EnableSorting="true"/> | |
<add Name="county" EnableSorting="true"/> | |
<add Name="country"/> | |
<add Name="grid_reference" /> | |
<add Name="latitude" /> | |
<add Name="longitude"/> | |
<add Name="postcode_sector"/> | |
</IndexUserFields> |
NewerOlder