Skip to content

Instantly share code, notes, and snippets.

View rasmuseeg's full-sized avatar
💭
Coding ofc.

Rasmus Eeg Møller rasmuseeg

💭
Coding ofc.
View GitHub Profile
@ashumkin
ashumkin / Delphi.VersionInfo.targets
Created July 29, 2016 07:54
FileVersion info set via MSBuild target
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' ToolsVersion="12.0">
<PropertyGroup Condition="($(VersionCode)!='' or $(VersionName)!='' or $(FileVersion)!='')">
<_PreResourceBuildTargets>_SetFileVersion</_PreResourceBuildTargets>
<CoreBuildDependsOn>$(_PreResourceBuildTargets);$(CoreBuildDependsOn)</CoreBuildDependsOn>
</PropertyGroup>
<UsingTask TaskName="__SetFileVersion" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll">
<ParameterGroup>
<VerInfoKeys ParameterType="System.String" Required="true" />
<VersionCode ParameterType="System.String" Required="false" />
<VersionName ParameterType="System.String" Required="false" />
@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)
@tomfulton
tomfulton / gist:2150553
Created March 21, 2012 18:10
Umbraco - GetMediaByPath
/// <summary>
/// Gets the media item by it's file path
/// </summary>
/// <remarks>
/// Example usage: Use in conjunction with HtmlAgilityPack or WYSIWYG.xslt to parse your RTE for Media Images, grab associated
/// properties from the Media node, and render them in your output (think alt tags, captions, etc).
/// TODO: support non "/media" directory, cleanup & further testing
/// </remarks>
/// <param name="mediaPath">Path to the uploaded file in the media directory</param>
/// <returns>Media node which contains the specified file</returns>
@kevinSuttle
kevinSuttle / meta-tags.md
Last active March 31, 2024 14:26 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags