Skip to content

Instantly share code, notes, and snippets.

View naepalm's full-sized avatar

Janae Cram naepalm

View GitHub Profile
@naepalm
naepalm / HasGridRow.cs
Last active July 20, 2018 15:06
Checks to see if a grid has a specific row.
public static bool HasGridRow(this GridDataModel model, string rowName)
{
if (model.Sections.Any())
{
foreach (var section in model.Sections)
{
if (section.HasRows)
{
foreach (var row in section.Rows)
{
@naepalm
naepalm / RadioButtonValueConverter.cs
Created August 31, 2018 15:30
Converts the core radio button automagically with ModelsBuilder from the value Id to the prevalue string. This does not use Dependency Injection, but it does work, so feel free to use it if you'd like!
using System;
using Umbraco.Core;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
using Umbraco.Web;
namespace Offroadcode.Web.PropertyConverters
{
class RadioButtonValueConverter : PropertyValueConverterBase, IPropertyValueConverterMeta
{
@naepalm
naepalm / MarkdownConverter.gs
Created January 8, 2019 18:19
Converts a Google Doc into Markdown and e-mails it to the account attached to the document. Open a doc and go to Tools > Script Editor then paste this code in and run it.
/*
Usage:
Adding this script to your doc:
- Tools > Script Manager > New
- Select "Blank Project", then paste this code in and save.
Running the script:
- Tools > Script Manager
- Select "ConvertToMarkdown" function.
- Click Run button.
- Converted doc will be mailed to you. Subject will be "[MARKDOWN_MAKER]...".
@naepalm
naepalm / TheEnd.md
Last active October 14, 2019 01:03
People say you only die once, but Bryce Kenoyer knows the unlucky ones have a chance to die twice.

The Witching Hour, October 12, 2019

She spent an entire five minutes standing in the woods a short walk from her house, screaming. It doesn't matter. Screaming her pain into the void has only resulted in something happening once over the last two years she's done it when the night has been particularly bad. And in that moment, there had been a gorgon. But tonight, with the worst news she's had in three years, Bryce needed to do something - even if it's entirely futile - to let it out.

That was a half an hour ago. Now, she's sitting in the treehouse, burrowed in her insulated sleeping bag with half a bottle of whiskey left and no end to the misery. But a crisp, clear October night means the stars are out and beautiful against the dark sky. So Bryce stares at it as she takes pulls from the bottle, body warm but face cold against the air, and she remembers.


Early Evening, January 17, 2016