Skip to content

Instantly share code, notes, and snippets.

:octocat:
Building stuff I'm excited about

David Darnes daviddarnes

Block or report user

Report or block daviddarnes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View reading-list.md
@daviddarnes
daviddarnes / pluralise.twig
Created Oct 31, 2017
Pluralising with Twig
View pluralise.twig
{% spaceless %}
{% if integer > 1 %}
{{ plural }}
{% else %}
{{ singular }}
{% endif %}
{% endspaceless %}
@daviddarnes
daviddarnes / repeatify.js
Last active Mar 14, 2017
repeatify test
View repeatify.js
function repeatify(count) {
let newString = this;
for (var i = 1; i < count; i++) {
newString += this;
}
return newString;
}
String.prototype.repeatify = repeatify;
@daviddarnes
daviddarnes / file-structure.md
Last active Jun 15, 2016
Jekyll theme file structure
View file-structure.md

root

  • garth-jekyll-theme.gemspec
  • _layouts
    • default.html
    • page.html
    • front.html
    • post.html
  • _includes
    • header.html
    • footer.html
@daviddarnes
daviddarnes / schema-index-new.html
Last active May 19, 2016
Revised Jekyll SEO Tag JSON LD structure
View schema-index-new.html
<!-- Proposed Index json output -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "Dave’s Blog",
"headline": "Dave’s Blog",
"image": "https://www.gravatar.com/avatar/6c0377abcf4da91cdd35dea4554b2a4c?s=600",
"description": "Articles, tutorials and other ramblings",
"publisher": {
View BBC-Recipes-Archive-Proposal.md

Steps to save the BBC Recipes Archive

  1. Setup an organisation on GitHub
  2. Create a repo called "theorgname".github.io
  3. Select a decent default Jekyll template
  4. Use this scraper? https://github.com/forbesg/bbc-good-food-recipe-scraper Or something similar to extract all the recipes (ideally in markdown)
  5. Upload the recipes to the repo, maybe under a new collection type
  6. See what we can do from there?
@daviddarnes
daviddarnes / _config.yml
Last active Apr 7, 2016
Jekyll head meta
View _config.yml
# Permalinks
permalink: pretty
# Posts
excerpt_separator: <!-- more -->
# Site info
url: "https://darn.es"
title: "David Darnes"
description: "Web Designer & Front-end Developer"
View GFM-rouge-configuation.html
Liquid highlight with language type: {% hightlight html %}
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt">&lt;html&gt;</span>
<span class="nt">&lt;p&gt;</span>Hi world<span class="nt">&lt;/p&gt;</span>
<span class="nt">&lt;/html&gt;</span></code><button class="button--copy">Copy <span class="octicon octicon-clippy"></span></button></pre></figure>
Backticks with language type: ``` html
<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;html&gt;</span>
You can’t perform that action at this time.