Skip to content

Instantly share code, notes, and snippets.

View daviddarnes's full-sized avatar
🧱
he/him

David Darnes daviddarnes

🧱
he/him
View GitHub Profile
@daviddarnes
daviddarnes / _config.yml
Last active April 7, 2016 14:52
Jekyll head meta
# Permalinks
permalink: pretty
# Posts
excerpt_separator: <!-- more -->
# Site info
url: "https://darn.es"
title: "David Darnes"
description: "Web Designer & Front-end Developer"
@sskylar
sskylar / _config.yml
Last active December 18, 2016 02:59
Custom Posts permalink in Jekyll
collections:
posts:
title: "Articles" # replace "Articles" with name of your choice
output: true
defaults:
- scope:
path: ''
type: posts
values:
@daviddarnes
daviddarnes / command-line.md
Last active May 28, 2017 19:35
Command line setup for new machine
  1. Install oh my zsh

  2. Install brew

  3. Install with brew install rbenv

  4. Setup rbenv

  • touch ~/.zshrc
  • open ~/.zshrc

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
/* eslint-env browser */
/* global jq: true */
const escaped = new Map([['<', '&lt;'], ['>', '&gt;']]);
const $$ = s => Array.from(document.querySelectorAll(s));
const $ = s => document.querySelector(s);
let jqLoaded = false;
const scrollPositions = [];
@molovo
molovo / gist:6907965
Last active September 16, 2019 03:47
A short snippet for exporting posts from Anchor CMS into separate .markdown files for use with Jekyll. Just add the created files straight into your _posts folder in jekyll. The following code goes into /anchor/routes/site.php, then just visit <site URL>/export to create the files
Route::get('export', function() {
$posts = Post::where('status', '=', 'published')->get();
foreach ($posts as $post) {
$content = <<<EOD
---
layout: post
title: "$post->title"
date: $post->created
categories: blog
@Andy-set-studio
Andy-set-studio / reset.css
Last active September 21, 2020 15:19
Minimal CSS reset
/* Box sizing rules */
* {
box-sizing: border-box;
}
*:before,
*:after {
box-sizing: inherit;
}
@netotaku
netotaku / .scss
Last active December 4, 2020 16:43
Wrote yet another grid system lads. This one is BEM + CSS Grids.
@mixin hgrid($columns, $gap, $break, $alias) {
display: grid;
grid-template-columns: repeat($columns, 1fr);
gap: $gap;
&__u{
grid-column: span $columns;
@bendc
bendc / simulate-typing.js
Created September 1, 2017 08:57
Fake typing animation
const trackTime = timing => {
const now = performance.now();
if (!timing.startTime) timing.startTime = now;
const elapsed = now - timing.startTime;
const {duration} = timing;
if (duration != null && duration <= elapsed) timing.startTime = null;
return elapsed;
};
const delay = (callback, duration) => {
<hr>
<div id="section-cta">
<div class="section-header text-center">
<h3> {{ section.settings.text-box }} </h3>
</div>
{% for block in section.blocks %}
<div class="btn" id="call-to-action">
<a href="{{ block.settings.link }}" class="btn">{{ block.settings.linktext }}</a>
</div>