Skip to content

Instantly share code, notes, and snippets.

@leekelleher
leekelleher / remove-wp-meta.php
Created January 22, 2013 10:30
WordPress plugin to remove the auto-generated meta tags.
<?php
/*
Plugin Name: Remove WP Meta
Plugin URI: http://leekelleher.com/
Description: This plugin removes the auto-generated WP meta tags from each webpage.
Author: Lee Kelleher
Version: 0.1.0
Author URI: http://leekelleher.com/
*/
@leekelleher
leekelleher / 1-umbraco-scripting.md
Last active December 10, 2015 12:38
Umbraco console/scripting concept

Umbraco scripting, with console/CLI

Enabling a scripting mechanism for Umbraco, using a console (command line interface) to execute the scripts/queries.

So far, the examples are using C#, however a suitable scripting language should be used. Currently JavaScript is the favourite, followed by Lua and Python.

@leekelleher
leekelleher / gist:4045132
Created November 9, 2012 10:56
SpaceOutCamelCase - Method to space out a string on capitals or numbers.
/// <summary>
/// Spaces out a string on capitals or numbers.
/// </summary>
/// <param name="input">The input string.</param>
/// <returns>
/// The string with spaces before each capital letter or number
/// </returns>
public static string SpaceOutCamelCase(string input)
{
var space = ' ';
@leekelleher
leekelleher / RegisterResource.cs
Created October 10, 2012 13:23
Example of hooking into an Umbraco back-office page using UmbracoClientDependencyLoader.TryCreate
using System;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using ClientDependency.Core;
using umbraco.BusinessLogic;
using umbraco.IO;
using umbraco.presentation.masterpages;
using umbraco.uicontrols;
@leekelleher
leekelleher / CheckImageGenModule.cs
Created October 10, 2012 09:39
ImageGenFetch - when taking a copy of an Umbraco site from a production server, the /media directory can be a huge download. So if using ImageGen you can auto-download the /media images on-demand.
using System;
using System.IO;
using System.Net;
using System.Net.Mime;
using System.Text;
using System.Web;
namespace Umbrella.ImageGenFetch
{
public class CheckImageGenModule : IHttpModule
@leekelleher
leekelleher / MntpModelBinder.cs
Created October 2, 2012 10:43
uComponents: Temporary ModelBinder proxy/stub for Umbraco core's MultiNodeTreePicker
namespace Our.Umbraco
{
using uComponents.Core.DataTypes.MultiNodeTreePicker; // for v4.x
// using uComponents.DataTypes.MultiNodeTreePicker; // for v5.x
using umbraco.editorControls;
using umbraco.MacroEngines;
[RazorDataTypeModel(DataTypeGuids.MultiNodeTreePickerId)]
public class MntpModelBinder : MultiNodeTreePickerModelBinder
{
@leekelleher
leekelleher / Web.Template.MACHINE-NAME.Debug.config
Created August 22, 2012 19:22
Web.config transform for Umbraco core development
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoDbDSN" value="server=.\SQLEXPRESS;database=umbraco;integrated security=true"/>
<!--<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoDbDSN" value="datalayer=SQLCE4Umbraco.SqlCEHelper,SQLCE4Umbraco;data source=|DataDirectory|\Umbraco.sdf"/>-->
<!--<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoDbDSN" value="datalayer=MySQL;database=umbraco;server=localhost;user id=username;password=password;"/>-->
<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoConfigurationStatus" value="4.9.0"/>
<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoUseMediumTrust" value="true"/>
</appSettings>
@leekelleher
leekelleher / Script-Umbraco-MSSQL.ps1
Created August 10, 2012 10:14
Powershell script to export an Umbraco MS-SQL database
[xml]$webconfig = Get-Content "web.config"
$conn = $webconfig.configuration.appSettings.SelectSingleNode("add[@key='umbracoDbDSN']").value
& 'C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Publishing\1.4\SqlPubWiz.exe' script -C "$conn" umbracoDbDSN.sql
@leekelleher
leekelleher / umbraco-package-ideas.md
Last active June 9, 2020 09:36
Umbraco Package Ideas
@leekelleher
leekelleher / README.md
Created July 9, 2012 14:19
Upgrading to Umbraco 4.8 breaks support for uComponents

Upgrading to Umbraco 4.8 breaks support for uComponents

For more information about the issue, please read: http://j.mp/umb48-breaks-ucomponents

Steps to workaround the issue

  • Take a copy of the "Lucene.Net.dll"
  • Create a new folder inside your /bin folder called "legacy", then put "Lucene.Net.dll" inside the new /bin/legacy folder.
  • In the root of your website, open the Web.config file in your favourite text-editor.