Skip to content

Instantly share code, notes, and snippets.

@JasonElkin
JasonElkin / ResponsiveImageHelper.cs
Last active November 8, 2021 17:37
Basic srcset generator for ImageProcessor in Umbraco v8
using System.Collections.Specialized;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Web;
namespace MooseCoding.Web.UI
{
public static class ResponsiveImageHelper
{
@1k-off
1k-off / article.md
Last active December 1, 2021 19:03

How to build Umbraco Cloud: the fresh approach

Surprisingly, all the articles that describe setting up CI/CD using Azure DevOps end up at the deployed-somewhat-to-somewhere status. I mean, they take csproj or sln, build it using MSBuild, and transfer the artifact to the release pipeline, in which the artifact is deployed to the web app. But often, this is not the result that we really want to get.

Most likely, we are configuring the CI/CD to provide a unified build and

@jondjones
jondjones / Tips for working with JSON in Visual Studio Code
Created September 30, 2021 06:29
Tips for working with JSON in Visual Studio Code
"json.schemas": [
{
"fileMatch": [
"/.myjsonfile"
],
"schema": {
"type": "object",
"properties": {
"properyExample" : {
"type": "string",
@tristolliday
tristolliday / optimisedImage.cshtml
Last active November 8, 2021 17:37
Umbraco 8 Optimised image
@*
Image Processor's WebP plugin must be installed via nuget first.
https://www.nuget.org/packages/ImageProcessor.Plugins.WebP/
*@
<picture>
<source srcset="@Model.Image.GetCropUrl(300, 300, furtherOptions: "&format=webp&quality=80")" type="image/webp">
<img src="@Model.Image.GetCropUrl(300, 300)" width="300" height="300" loading="lazy" alt="@Model.Image.Name" />
</picture>
@bgoonz
bgoonz / awesome.json
Created August 16, 2021 23:42
for awesome-search
{
"Platforms": [
{
"name": "Node.js",
"url": "https://github.com/sindresorhus/awesome-nodejs",
"repo": "sindresorhus/awesome-nodejs",
"cate": "Platforms"
},
{
"name": "Node.js - Cross-Platform",
@jondjones
jondjones / Security Concerns You Need To Consider When Developing an Umbraco website
Created August 12, 2021 07:26
Security Concerns You Need To Consider When Developing an Umbraco website
<httpCookies requireSSL="true" />
<div class="map-responsive" style="overflow:hidden; padding-bottom:56.25%; position:relative; height:0;">
<iframe src="xxx" width="600" height="450" frameborder="0" style="border:0; left:0; top:0; height:100%; width:100%; position:absolute;" frameborder="0" allowfullscreen="allowfullscreen" allow="accelerometer;" allowfullscreen="" loading="lazy"></iframe>
</div>
@tristolliday
tristolliday / Umbraco9Images.cshtml
Last active November 8, 2021 17:38
Responsive, high performance images in umbraco 9
@* /Views/Partials/ResponsiveImage.cshtml *@
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@using Umbraco.Cms.Core.Media
@using Umbraco.Cms.Core.Models.PublishedContent
@using Umbraco.Cms.Core.Routing
@{
var publishedContent = @ViewData["publishedContent"] as IPublishedContent ?? null;
var lazyLoading = @ViewData["lazyLoading"] ?? false;
@jondjones
jondjones / Easy Responsive Images in Umbraco With Slimsy - 6
Created June 5, 2021 05:45
Easy Responsive Images in Umbraco With Slimsy - 6
Url.GetSrcSetUrls(IPublishedContent publishedContent, int width, int height)
@Matthew-Wise
Matthew-Wise / HomePageController.cs
Last active November 8, 2021 17:38
Umbraco v9 RenderMvcController replacement options
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ViewEngines;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Web;
using Umbraco.Cms.Web.Common.Controllers;
using Umbraco.Cms.Web.Common.PublishedModels;