Skip to content

Instantly share code, notes, and snippets.

@dry
dry / documentation.html
Created April 26, 2011 14:58
Peanut CMS Documentation Layout
<!DOCTYPE html>
<html lang="en">
<head>
<title>Peanut Documentation | {title}</title>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" media="screen" href="/assets/css/documentation.css">
</head>
<body>
<div id="container">
<h1><a href="/" title="Peanut CMS">Peanut</a>: <a href="/documentation/">Documentation</a>: {title}</h1>
@dry
dry / config.php
Created April 26, 2011 16:16
Peanut Config Example
$config = array(
'system_folder' => 'peanut',
'default_layout' => 'main.html',
'text_parser' => 'textile'
);
@dry
dry / documentation.txt
Created April 26, 2011 17:18
Peanut CMS Documentation Page
layout:
documentation.html
--
title:
Layouts
--
summary:
h2. Layouts
@dry
dry / gist:942887
Created April 26, 2011 19:15
Pages Layout
octopus:peanut.intranet greg$ ls -l peanut/pages/
total 8
drwxr-xr-x 7 greg staff 238 26 Apr 20:09 documentation
-rw-r--r-- 1 greg staff 127 26 Apr 11:17 index.txt
@dry
dry / gist:943297
Created April 26, 2011 22:07
Page Subdirectory Layout
octopus:peanut.intranet greg$ ls -l pages/documentation/
total 40
-rw-r--r-- 1 dry staff 1920 26 Apr 22:55 configuration.txt
-rw-r--r-- 1 dry staff 983 26 Apr 22:55 index.txt
-rw-r--r-- 1 dry staff 1022 26 Apr 01:00 install.txt
-rw-r--r-- 1 dry staff 1499 26 Apr 22:55 layouts.txt
-rw-r--r-- 1 dry staff 834 26 Apr 22:55 pages.txt
@dry
dry / gist:943413
Created April 26, 2011 23:36
Page Fields
layout:
documentation.html
--
title:
Page Custom Fields
--
summary:
h2. Page Custom Fields
@dry
dry / mixins.php
Created December 7, 2011 20:50
A possible way to simulate mixins in PHP
<?php
class Person {
private $mixins = array();
private $instances = array();
public function __construct()
{
if (func_num_args())
@dry
dry / gist:3438221
Created August 23, 2012 16:20
Rewrite Force HTTPS
RewriteCond %{HTTPS} off
RewriteCond $1 ^(section|othersection) [NC]
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond $1 ^(anothersection|anothersection|anothersection) [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
@dry
dry / bash.sh
Created October 28, 2012 00:58 — forked from nstielau/bash.sh
Set node attributes, run_list, chef_environment, etc
knife node configure my_node.example.com
@dry
dry / gist:4017752
Created November 5, 2012 15:22 — forked from ckimrie/gist:3312619
Example extension that allows you to modify the final ExpressionEngine CP output
<?php
/**
* Modifying the final CP Output
*
* This extension demonstrates how you can access and modify the final ExpressionEngine
* CP output. It is not a hack, but it is a new technique that to my knowledge has not
* been used before in an EE addon.
*
* This has not been road tested and its side effects are unknown, so use this at your own risk.