Skip to content

Instantly share code, notes, and snippets.

@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) {
@nobodyiscertain
nobodyiscertain / example.conf
Last active August 29, 2015 14:05
nginx Config for Statamic 1.8.2
server {
server_name example.com;
root /var/www/example.com/public;
index index.php;
access_log /var/www/example.com/logs/access.log;
error_log /var/www/example.com/logs/error.log;
add_header "X-Built-With" "Statamic";
@bauhouse
bauhouse / date-time.xsl
Created October 16, 2011 15:37
Project Template
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Description:
This is a date formatting utility. The named template "format-date" takes 2 parameters:
1. date - [required] takes an ISO date (2005-12-01)
@bauhouse
bauhouse / symphony-reset.sh
Created October 16, 2011 16:16
Delete Files to Reinstall Symphony CMS
sudo rm -rf .htaccess install-log.txt manifest
@bauhouse
bauhouse / home.xml
Created October 27, 2011 22:23
Master XSL Template with overrides
<?xml version="1.0" encoding="utf-8" ?>
<data>
<params>
<today>2011-10-27</today>
<current-time>16:00</current-time>
<this-year>2011</this-year>
<this-month>10</this-month>
<this-day>27</this-day>
<timezone>-07:00</timezone>
<website-name>Symphony CMS</website-name>
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<link rel="stylesheet" href="workspace/assets/style.css"/>
</head>
<body>
<div id="head">
<h1>Title</h1>
</div>
<div id="package">
# rewrite from example.com to www.example.com
server {
listen 80;
server_name example.com;
rewrite ^(.+?)/?$ http://www.example.com$1 permanent;
}
server {
listen 80;
server_name www.example.com;
location / {
index index.php;
# serve static files directly
if (-f $request_filename) {
access_log off;
expires 30d;
break;
}
@brendo
brendo / event.google_calendar_import.php
Created March 29, 2012 14:05
Google Calendar Event
<?php
require_once EXTENSIONS . '/xmlimporter/extension.driver.php';
require_once EXTENSIONS . '/google_calendar_api/lib/class.json_to_xml.php';
require_once TOOLKIT . '/class.gateway.php';
Class eventgoogle_calendar_import extends Event {
const ROOTELEMENT = 'google-calendar-import';
const GOOGLE_ENDPOINT = 'https://www.googleapis.com/calendar/v3/calendars/%s/events?fields=%s&key=%s';
@brendo
brendo / backend.html
Created April 13, 2012 15:14
Symphony Backend markup
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- Core styles -->
<link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.css">
<link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.legacy.css">
<link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.grids.css">