Skip to content

Instantly share code, notes, and snippets.

@getify
getify / 1.html
Last active March 1, 2025 22:35
Ever noticed how vw/vh units in CSS seem to be a bit unreliable on various devices (especially mobile)? Here's my solution.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<title>Test Page</title>
<script>
// early compute the vw/vh units more reliably than CSS does itself
computeViewportDimensions();
@DanDiplo
DanDiplo / BlockListCreatorService.cs
Last active July 26, 2024 05:58
Create Blocklist JSON programmatically in Umbraco
/// <summary>
/// Helper service for creating JSON necessary for creating block list items programatically using Umbraco <see cref="ContentService"/>
/// </summary>
/// <remarks>
/// Based of this: https://github.com/umbraco/UmbracoDocs/blob/e64ec0e5b28b4e5a37b7865691621e45dd82701f/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Block-List-Editor/index.md
/// It's intended for simple content
/// </remarks>
public class BlockListCreatorService
{
/// <summary>