Skip to content

Instantly share code, notes, and snippets.

View matthewpennell's full-sized avatar

Matthew Pennell matthewpennell

View GitHub Profile
@matthewpennell
matthewpennell / css_selector
Created December 4, 2014 11:26
CSS selector
.demo {
display: inline-block;
overflow: visible;
background-color: #e6edf6;
color: #666;
font-weight: normal;
text-decoration: none;
white-space: nowrap;
vertical-align: top;
margin-left: 1em;
@matthewpennell
matthewpennell / EE Master Comments Feed
Created January 27, 2009 21:15
Example ExpressionEngine RSS template for creating a feed of all your recent comments, reverse date ordered
{assign_variable:master_weblog_name="journal|linklog|sidebar"}
{exp:rss:feed weblog="{master_weblog_name}"}
<?xml version="1.0" encoding="{encoding}"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>{exp:xml_encode}My Comments Feed{/exp:xml_encode}</title>
<link>http://www.example.com/</link>
<description>Comments on my site</description>
<dc:language>{weblog_language}</dc:language>
<dc:creator>rss@example.com</dc:creator>
# !/bin/bash
# Set up an new github repository
GITHUB_USERNAME="timkelty"
# from github instructions page after creating a repo
mkdir "$1"
cd "$1"
git init
touch README
.sprite-source-foo, .sprite-source-bar, .sprite-source-baz {
background-image:url('source.png');
background-repeat:no-repeat;
}
.sprite-source-foo {
background-position: 0 0;
width: 25px;
height: 25px;
}
/* This file is generated by an automatic script.
Do not attempt to make changes to it manually! */
.sprite {
background-image: url('/path/to/sprite.png');
background-repeat: no-repeat;
}
.foo {
background-position: 0 0;
width: 25px;
.sprite {
background-image: url('/path/to/sprite.png');
background-repeat: no-repeat;
}
{% for image in images %}
{% if image.pseudo %}
.sprite .sprite-container{{ image.pseudo }} .{{ image.label }},
{% endif %}
.{{ image.label }}{{ image.pseudo }} {
<div class="calendar sprite-container">
<i class="sprite calendar-icon"></i>
<h2>Calendar</h2>
</div>
@matthewpennell
matthewpennell / gist:973194
Created May 15, 2011 14:18
Regular expressions in .htaccess
# Set browser and version environment variables based on the visitor's browser
SetEnvIfNoCase User-Agent (Opera|Chrome|Version|Firefox|MSIE)[\/|\s](\d+)\. browser=$1 version=$2
SetEnvIf browser Version browser=Safari
SetEnvIf browser MSIE browser=IE
@matthewpennell
matthewpennell / gist:3098465
Created July 12, 2012 14:30
Quick and dirty ExpressionEngine blank page debugging
// Switch on all error displays, both by trying to override php.ini, and using the reporting function.
ini_set('display_errors', 1);
error_reporting(E_ALL);
// Also try upping the memory limit for the PHP script, in case we're hitting that limit.
ini_set('memory_limit', '256M');
@matthewpennell
matthewpennell / Column layout
Created July 8, 2013 18:58
Creating column layouts with CSS3
#content {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
-webkit-column-gap: 50px;
-moz-column-gap: 50px;
column-gap: 50px;
-webkit-column-rule: 1px solid #ccc;
-moz-column-rule: 1px solid #ccc;
column-rule: 1px solid #ccc;