Skip to content

Instantly share code, notes, and snippets.

@RAGNOARAKNOS
RAGNOARAKNOS / hugo-survival-guide.md
Created March 19, 2026 16:52 — forked from janert/hugo-survival-guide.md
A Hugo Survival Guide

A Hugo Survival Guide

Hugo is a static site generator: it takes some plain-text content, marries it to a bunch of HTML templates, and produces a set of complete, static HTML pages that can be served by any generic, stand-alone web server. Simple.

Or maybe not. Hugo does a lot of things automatically, relying on conventions and implicit rules, rather than on explicit configuration. For example, it tries to match each piece of content with the most

@RAGNOARAKNOS
RAGNOARAKNOS / SimpleContract.cs
Created July 13, 2016 13:46
Simple version of Code Contracts
using System;
using System.Diagnostics;
/// <summary>
/// Provides conditional contract assertions.
/// </summary>
public static class Contract
{
#region NotNull
/// <summary>
@RAGNOARAKNOS
RAGNOARAKNOS / PeskySSL.cs
Created July 12, 2016 16:52
Remove those pesky SSL failures in a devtest environment
using System.Net;
// Apply SSL authentication workaround to bypass SSL enforcement for local development
ServicePointManager.ServerCertificateValidationCallback =
(sender, cert, chain, sslPolicyErrors) => true;
@RAGNOARAKNOS
RAGNOARAKNOS / HttpContentExtensions.cs
Created July 5, 2016 10:02
Extend the .NET HTTPContent class (used by HTTPClient) to download files, with usage example
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Security.Cryptography;
using System.Text;