Skip to content

Instantly share code, notes, and snippets.

@pathawks
pathawks / README.md
Created November 5, 2011 20:58
Simple Jekyll feed

Jekyll Feed

A safe way to add an Atom feed to a Jekyll site

In _config.yml you should define the following

  • url
  • title
  • owner
  • owner_email
@pathawks
pathawks / Jekyll sitemap.md
Last active September 27, 2015 22:28 — forked from metaskills/jekyll_sitemap.markdown
Jekyll sitemap.xml

Jekyll Sitemap

The best way to add a sitemap to a Jekyll site is with the jekyll-sitemap plugin.

In your _config.yml

gems:
- jekyll-sitemap
@pathawks
pathawks / OpenGraph for Blogger.md
Last active October 28, 2023 23:41
OpenGraph for Blogger

Adding Open Graph metadata to Blogger is easy. Simply copy the code below and paste it into your template after the <header> tag.

A couple notes:

  • og:locale Should probably actually reflect the blog's locale instead of just being a hardcoded string. Unfortunately, Blogger only gives us en-us with a hyphen, instead of an underscore, so that won't work.
  • If you're using your blog as a personal profile, you may consider changing the second og:type from website to profile and adding your personal information
  • og:image Is only supplied if Blogger finds an image in the current post. However, not supplying og:image is invalid. You could provide an alternate image of your blog logo, or a Gravatar.
  • If you do something cool with this, I'd love to hear about it. pathawks@shortmail.com
@pathawks
pathawks / Liquid Minify for Jekyll.md
Last active November 20, 2023 13:52
Liquid Minify

Simply call this template from your master Jekyll template, and your site will be (more or less) minified

@pathawks
pathawks / meta.html
Last active May 20, 2020 19:27
Open Graph for Jekyll
{% if include.content %}
<meta property="{{ include.property }}" content="{{ include.content }}" />
{% endif %}
@pathawks
pathawks / ems.sh
Created March 10, 2012 21:24
EMS Flasher tutorial
cd ~/Downloads
./ems-flasher --read "photos.sav"
@pathawks
pathawks / photon.php
Created December 12, 2012 04:15
Trying to get Photon to output height and width attributes, to help with page rendering
<?php
/**
* Module Name: Photon
* Module Description: Give your site a boost by loading images from the WordPress.com content delivery network.
* Sort Order: 15
* First Introduced: 2.0
*/
class Jetpack_Photon {
/**
<?php
/*
* WHAT DOES THIS CODE DO?
*
* When using get_adjacent_post(), there is no way to restrict posts to one or two
* categories, if the categories in question are not identical to the current post.
* We get arround that by requesting a list of EVERY CATEGORY EXCEPT the one in
* question, and then pass that as our list of 'excluded' categories.
*
* Take a deep breath.
@pathawks
pathawks / YouTube Embed for Jekyll.md
Last active December 15, 2015 18:19 — forked from joelverhagen/README.md
Jekyll plugin to embed YouTube videos

This is a plugin meant for Jekyll.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

{% youtube oHg5SJYRHA0 %}
<?php /* With apologies to Dr. Drang and John Siracusa.
feed-subscribers.php
By Marco Arment.
Released into the public domain with no warranties and no restrictions.
Usage: Pipe an Apache access log into stdin, e.g.:
php -f feed-subscribers.php < /var/log/httpd/access_log