Skip to content

Instantly share code, notes, and snippets.

View budparr's full-sized avatar
🎯
Focusing

Bud Parr budparr

🎯
Focusing
View GitHub Profile
@budparr
budparr / calendar-for-static-sites.js
Last active August 29, 2015 14:01
A calendar solution for static sites
this is now located at: https://github.com/budparr/jekyll-calendar
// REQUIRES MOMENT.JS AND UNDERSCORE.JS
// This still needs to be templated and cleaned up and commented.
// original idea came from (I think) seattlehacks.com
// you will need to add events via a JSON file
// OR use this YAML to have content people create lists of events https://gist.github.com/budparr/5b21dccf318e723834e9
// use this JSON generator to create JSON for list below https://gist.github.com/budparr/ee901ba06f29cf1db637
var timing = function(start, end) {
@budparr
budparr / static-site-calendar-yaml
Created May 12, 2014 22:02
Use this YAML so content people can easily add event listings. Convert the events into JSON and display using underscore.js and moment.js
-
title:
venue:
address:
city-state:
zip:
website:
allday: true
start: 2014-06-11 18:00:00
end: 2014-06-11 19:30:00
@budparr
budparr / static-site-calendar-json
Created May 12, 2014 22:03
Jekyll JSON generator for calendar
---
layout: none
---
{"events": [{% assign first = true %}
{% for post in site.data.events reversed %}
{% if first == false %},{% endif %}
{% if first == true %}{% assign first = false %}{% endif %}
{
"name" : "{{ post.title }}",
"allday" : "{{ post.allday }}",
@budparr
budparr / jekyll-google-analytics-tag
Created May 20, 2014 18:26
Google Analytics for Jekyll sites
in _config.yml I put
google_analytics_id: YOURID
and likely you already have url: www.example.com
Include the code below in your site header before </head>
---
{% if site.google_analytics_id %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

Versions

A "version" is described by the v2.0.0 specification found at http://semver.org/.

A leading "=" or "v" character is stripped off and ignored.

Ranges

The following range styles are supported:

@budparr
budparr / jekyll-layout-default
Created December 2, 2014 13:09
Default basic layout for a Jekyll site
<!DOCTYPE html>
<html>
{% include head.html %}
<body>
{% include header.html %}
<div class="page-content">
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// Simple, single configuration file to override almost all paths and server settings. As used by @airways
// and @litzinger.
// Only check in the default as dist.config.php, set your version control system to ignore config.php so that
// local users and each instance (staging, production) can have their own settings.
// These config files are mainly meant to be used on a shared development server used by all developers,
// although it works almost as well for local development as well.
@budparr
budparr / webhook-robots.txt
Created January 12, 2015 17:34
Webhook robots.txt file
User-Agent: *
Disallow:{% if getSetting('analytics_id') %} /cms/{% else %} /{% endif %}
@budparr
budparr / serial-comma-swig
Created January 30, 2015 23:58
Serial comma with Swig Templating Language: "x and y" or "x, y, and z" (not url specific to Webhook)
<a href="{{ url(object) }}">{{ object.name }}</a>{% if loop.revindex != 2 %}{% if not loop.last %}, {% endif %}{% endif %}{% if loop.revindex == 2 %} and {% endif %}