Skip to content

Instantly share code, notes, and snippets.

View villian's full-sized avatar
🏠
Open to new opportunities

Oleksandr Skrypnyk villian

🏠
Open to new opportunities
View GitHub Profile
@niksumeiko
niksumeiko / disable-html-form-input-autocomplete-autofill.md
Last active May 2, 2024 10:43
Disable HTML form input autocomplete and autofill

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...
@dampee
dampee / umbraco db cleanup.sql
Last active November 9, 2021 12:57
Umbraco Database cleanup. After pulling in an umbraco database from production, you don't need all history or log.
-- Umbraco Clear Old Document Versions To Decrease Database Size And Improve Performance
-- http://borism.net/2008/12/16/fixing-a-large-cmspropertydata-table-in-umbraco/
DECLARE @createdDate Datetime = DATEADD(m, -1, getdate())
-- dump logs
-- TRUNCATE TABLE umbracolog -- faster if log table is very big and you don't need anything
DELETE FROM umbracolog WHERE Datestamp < @createdDate
-- clean up old versions
DELETE FROM cmsPropertyData WHERE
@TimGeyssens
TimGeyssens / Contour send email workflow
Created May 11, 2015 13:17
Contour send email workflow
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Web;
using Umbraco.Forms.Core.Enums;
using System.Text.RegularExpressions;
using Umbraco.Forms.Data.Storage;
using System.Xml;
@EdCharbeneau
EdCharbeneau / AsJson.cshtml
Last active November 8, 2021 17:37
Turn any Umbraco content into a JSON object by using a Razor template
@*Experimental, I'm still fairly new to Umbraco there could be an API avialbe for this already.
This was inspired by http://cultiv.nl/blog/razor-vs-base-to-output-json-in-umbraco/
If there is a better way please let me know via twitter @EdCharbeneau
Add this template to your Umbraco site and any content can be called via Ajax using
/mySite/contentPath/?alttemplate=AsJson
Return value will be { propertyAlias : value }
Ex: { "personAlias" : "John Doe", "id" : 1002 }
*@
@mattbrailsford
mattbrailsford / Bootstrap.cs
Created August 7, 2014 12:50
Indexing JSON values in Umbraco
public class Bootstrapper : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
base.ApplicationStarted(umbracoApplication, applicationContext);
ExamineManager.Instance.IndexProviderCollection["ExternalIndexer"]
.GatheringNodeData += (sender, e) =>
{
// Extract JSON properties
@sitereactor
sitereactor / MediaEventHandler.cs
Last active July 12, 2023 02:33
Renaming an image when its uploaded to a property with Alias "umbracoFile", but before its saved. The name of the image will be changed to the name of the folder it resides in. This is using the Saving event in the MediaService in Umbraco.
using Umbraco.Core;
using Umbraco.Core.Events;
using Umbraco.Core.IO;
using Umbraco.Core.Services;
namespace Startup
{
public class MediaEventHandler : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)