Skip to content

Instantly share code, notes, and snippets.

@Antonytm
Antonytm / HtmlCache.aspx
Created April 11, 2018 09:19
Discovering what is inside Sitecore HTML Cache
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HtmlCache.aspx.cs" Inherits="Sitecore.Utils.HtmlCacheList" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<form id="form1" runat="server">
<asp:Repeater ID="WebsiteCache" runat="server" ItemType="System.Tuple`2 [System.String, System.String]">
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
@Antonytm
Antonytm / GetCacheKeys.cs
Created May 7, 2018 15:15
Sitecore.Rocks: adding values for data table
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.IO;
using System.Reflection;
using System.Xml;
using Sitecore.Caching;
using Sitecore.Caching.Generics;
using Sitecore.Configuration;
using Sitecore.Data;
@Antonytm
Antonytm / HexEncoding.cs
Created May 21, 2018 13:57
Looking what is present in ASP.Net session object
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionDeserialize
{
public class HexEncoding
{
@Antonytm
Antonytm / gulp-config.js
Last active December 6, 2019 16:39 — forked from cassidydotdk/gulp-config.js
Task to build and publish a .SLN file from gulp using "msbuild" instead of "gulp-msbuild". Version 16.0 for VS2019, use 15.0 for VS2017.
module.exports = function () {
var config = {
websiteRoot: "C:\\inetpub\\wwwroot\\sc911.sc",
sitecoreLibraries: "C:\\inetpub\\wwwroot\\sc911.sc\\bin",
hostName: "http://sc911.sc",
solutionName: "sc911",
buildConfiguration: "Debug",
runCleanBuilds: false,
toolsVersion: "16.0"
}
@Antonytm
Antonytm / JssFieldsExtender.cs
Last active August 3, 2022 20:47 — forked from IvanLieckens/JssFieldsExtender.cs
Sitecore JSS GraphQL schema extension to output fields in JSS format
using GraphQL.Types;
using Newtonsoft.Json;
using Sitecore.Configuration;
using Sitecore.Data.Items;
using Sitecore.Data.Fields;
using Sitecore.Diagnostics;
using Sitecore.LayoutService.Serialization.FieldSerializers;
using Sitecore.LayoutService.Serialization.ItemSerializers;
using Sitecore.LayoutService.Serialization.Pipelines.GetFieldSerializer;
using Sitecore.Services.GraphQL.Content.GraphTypes;
@Antonytm
Antonytm / pre-commit.sh
Created August 27, 2022 10:59
Pre-commit Git hook that validates Sitecore serialization
#!/bin/sh
# Pre-commit Git hook
# It runs Sitecore CLI Serialization check
# And doesn't allow to perform commit if serialization is broken
validate=$(dotnet sitecore ser validate)
regex_errors="Errors were detected"
count=$(echo "${validate}" | grep -c "${regex_errors}")
if test $count -gt 0
then
echo "Sitecore serialization errors were detected"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Audacity script to prepare long audio books or podcasts for listening in the swimming pool.
# The script will amplify the audio, because the volume usually is too low for the underwater speakers.
# It will also add DTMF tones every XX minutes, so the listener knows how much time has passed.
# It is very convenient to know how much time has passed, especially in Ukraine, when there is electricity outage. When you don't see the clock.
# The script will also add labels every XX minutes, so you can export multiple files for easier navigation between parts.
# Before running the script, make sure Audacity is running first and that mod-script-pipe is enabled