Skip to content

Instantly share code, notes, and snippets.

View N-Parsons's full-sized avatar

Nathan Parsons N-Parsons

  • Coventry, UK
View GitHub Profile
@N-Parsons
N-Parsons / summary-explicitness.php
Created May 15, 2019 11:30
Grav plugin/function to determine whether there is an explicit summary in the page content. This allows you to safely slice the summary off using "{{ content|slice(page.summary|length)|raw }}" if "page.header.has_explicit_summary" is true.
<?php
namespace Grav\Plugin;
use Grav\Common\Plugin;
use \RocketTheme\Toolbox\Event\Event;
class SummaryExplicitnessPlugin extends Plugin
{
public static function getSubscribedEvents()
{
@N-Parsons
N-Parsons / version_status.json
Last active October 12, 2017 10:00
Version status for tests in exercism/python (2017-10-12)
{
"up-to-date": [],
"up-to-date (x-common)": [
"acronym",
"allergies",
"alphametics",
"anagram",
"atbash-cipher",
"bob",
"book-store",
@N-Parsons
N-Parsons / check_test_versions.py
Last active October 12, 2017 09:47
Script for checking version numbering in test files for exercism/python
import json
import os
import re
# There are probably others that don't require canonical data
NO_DATA = {"beer-song", "house", "robot-name", "zebra-puzzle", "twelve-days"}
@N-Parsons
N-Parsons / keybase.md
Last active October 3, 2017 23:00
keybase.md

Keybase proof

I hereby claim:

  • I am n-parsons on github.
  • I am nparsons (https://keybase.io/nparsons) on keybase.
  • I have a public key ASAEQybTwSstWIOFlxqABs6ih4icZNIC6w33G6wyuwrSRAo

To claim this, I am signing this object: