Skip to content

Instantly share code, notes, and snippets.

👨‍💻
Making things to help others make things

David Darnes daviddarnes

👨‍💻
Making things to help others make things
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
@daviddarnes
daviddarnes / head.html
Last active Aug 29, 2015
Anchor Themes head meta
View head.html
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feeds/rss">
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="generator" content="CMS name">
<!-- Open graph meta -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="Website title">
@daviddarnes
daviddarnes / film-list.md
Last active Aug 29, 2015
Films I like but you might too
View film-list.md
  • Taken
  • Unknown
  • Bourne Identity (and the rest of Matts)
  • Ronin
  • Old Boy (original)
  • Hostel (fair bit of action for a horror)
  • Eagle Eye
  • The Transporter (the sequels aren't as good)
  • I am Legend
  • Inception
View mods.css
body {
background-color: #333;
color: #B8B8B8;
text-align: center;
}
h2 {
font-weight: 500;
}
View dabblet.html
<!DOCTYPE html>
<style>
body, html {
height: 100%;
overflow: hidden;
margin: 0;
padding: 0;
background: black;
}
@daviddarnes
daviddarnes / parallax-scrolling.js
Created Oct 20, 2015
Parallax scrolling with JavaScript
View parallax-scrolling.js
// Parallax header content
window.onscroll = function emParallax() {
if(window.pageYOffset>1) {
document.getElementById("parallax").style["-webkit-transform"] = "translateY("+(window.pageYOffset/3)+"px)";
} else {
document.getElementById("parallax").style["-webkit-transform"] = "translateY(0px)";
}
}
@daviddarnes
daviddarnes / Anchor Custom Article Field
Created May 26, 2013
For outputting a custom field marked with 'image' in the database within an article.
View Anchor Custom Article Field
<?php
/*
This is to show a custom field from an article.
It will need to be created in the metadata section before it can be used in the post edit area.
In this case the custom field will need to be called 'image' and be set as an image custom field in the dropdown for type.
*/
$image = article_custom_field('image'); // Applying a variable to the custom field, so it can be reused with ease
if ( !empty($image) ) : // Check if the field is empty, if it is the process stops here
?>
<figure>
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>
@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"
You can’t perform that action at this time.