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
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 / 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 / command-line.md
Last active May 28, 2017
Command line setup for new machine
View command-line.md
  1. Install oh my zsh

  2. Install brew

  3. Install with brew install rbenv

  4. Setup rbenv

  • touch ~/.zshrc
  • open ~/.zshrc
View mods.css
body {
background-color: #333;
color: #B8B8B8;
text-align: center;
}
h2 {
font-weight: 500;
}
@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
@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 / Anchor CMS Open Graph Meta
Last active Jan 19, 2017
Open Graph meta information for Facebook and Google+
View Anchor CMS Open Graph Meta
<!-- Open graph meta -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="<?php echo site_name(); ?>">
<?php if(is_homepage() == true) : ?>
<meta property="og:url" content="http://websiteaddress.com">
<meta property="og:title" content="<?php echo site_name(); ?>">
<meta property="og:description" content="<?php echo site_description(); ?>">
<?php else: ?>
<meta property="og:url" content="<?php echo "http://websiteaddress.com/" . current_url(); ?>">
<meta property="og:title" content="<?php echo page_title('Page can’t be found'); ?> - <?php echo site_name(); ?>">
@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>
You can’t perform that action at this time.