Skip to content

Instantly share code, notes, and snippets.

{exp:weblog:entries}
{exp:my_module:my_method}
{if alt_title != ""}{alt_title}{if:else}{title}{/if}
{/exp:my_module:my_method}
{/exp:weblog:entries}
#!/usr/bin/env python
from __future__ import with_statement # needed for python 2.5
from fabric.api import *
from fabric.contrib.console import confirm
# ================================================================
# NOTE:
# using this fabfile expects that you have the python utility
# fabric installed locally, ssh access to reamea.com, and your
# ssh public key associated with the account 'mboza@reamea.com'
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the
@jamiepittock
jamiepittock / gist:1360274
Created November 12, 2011 09:07
Update password form
{embed="layout/_start"
body_class=""
section=""
{!-- BETTER META OPTIONS BELOW --}
title=""
title_suffix=""
title_prefix=""
description=""
keywords=""
robots_index=""
@jamiepittock
jamiepittock / gist:1360275
Created November 12, 2011 09:09
Update profile form
{embed="layout/_start"
body_class=""
section=""
{!-- BETTER META OPTIONS BELOW --}
title=""
title_suffix=""
title_prefix=""
description=""
keywords=""
robots_index=""
@jamiepittock
jamiepittock / gist:2708107
Created May 16, 2012 06:42
An old Jambor-ee article: A future recipe for ExpressionEngine?

Written by Simon Rudkin (@simonrudkin), this article was originally published on the now defunct, mythical EE fansite Jambor-ee (beautifully crafted by @jamiepittock for at least 3 weeks) back in January 2009.

I was reminded of it after reading the recent chatter on Twitter and various blogs about ExpressionEngine and themes so thought it was worth republishing.

A future recipe for ExpressionEngine?

January 28th 2009

I’ve just finished making a really tidy events calendar using ExpressionEngine. It keeps the events in one weblog, venues in another, uses custom fields to add a Google Maps link for each venue, and pulls it all together in a template group that splits events into upcoming and archived. Just the kind of project that EE handles with aplomb, and I’d love to share it with you but, erm… w

{exp:cartthrob:customer_info}
{exp:cartthrob:save_customer_info_form return=""}
<p>
Select a country: {exp:cartthrob:country_select name="customer_country_code" selected="{customer_country_code}"}
</p>
<p>
current selected country code: {customer_country_code}
</p>
<p>
<input type="submit" name="Submit" />
// Hidden form on checkout page
<div style="display: none">
{exp:cartthrob:save_customer_info_form
return=""
id="customer_form"
}
<input type="hidden" name="country_code" id="hidden_country" value="" />
{/exp:cartthrob:save_customer_info_form}
</div>
SELECT ct.entry_id, ct.title, ct.url_title, cd.field_id_344 as cf_places_latitude, cd.field_id_345 as cf_places_longitude, ROUND( '3959' * acos( cos( radians('51.494737') ) * cos( radians( cd.field_id_344 ) ) * cos( radians( cd.field_id_345 ) - radians('-0.146358') ) + sin( radians('51.494737') ) * sin( radians( cd.field_id_344 ) ) ), '2' ) AS distance
FROM exp_channel_data as cd
LEFT JOIN exp_channel_titles as ct ON ct.entry_id = cd.entry_id
WHERE ct.channel_id IN ('2')
AND ct.entry_id != '12'
HAVING distance < '1'
ORDER BY distance desc
@jamiepittock
jamiepittock / ExpressionEngine template
Created November 23, 2012 11:48
Inject events from low_events:entries into low_events:calendar cells
{exp:low_events:calendar
events_field="cf_events_date_time"
date="{freebie_4}"
}
<table class="calendar" cellspacing="0" cellpadding="0">
<thead>
<tr id="month_pager">
<th colspan="1" class="previous"><a href="{structure:page:uri}
on/{prev_month_url}" title="{prev_month format='%F %Y'}">&larr;</a></th>
<th colspan="5" class="month_title"><a href="{structure:page:uri}