Skip to content

Instantly share code, notes, and snippets.

View pmeissner's full-sized avatar

Philip Meissner pmeissner

View GitHub Profile
@pmeissner
pmeissner / ajax_handlers.php
Created September 23, 2011 01:43
Moving from billing to pay in 1 step.
<?
function download_only_on_process_billing_address_place_order_and_pay($controller, $page, $params)
{
if (post('ship_to_billing_address'))
{
Shop_CheckoutData::copy_billing_to_shipping();
$controller->action();
}
<?
public static function generate_url($file_key) {
$s3 = self::get_s3();
$link = ArclightAWSExpiring_Link::create()->where('file_key = ?', $file_key)->find();
if (!$link)
throw new Phpr_ApplicationException('We are sorry, but the link could not be found');
return $s3->get_object_url(self::$configuration->bucket, $file_key, '10 Seconds',
array('response' => array('content-disposition' => 'attachment; filename=' . $link->file_name))
);
@pmeissner
pmeissner / statamic count
Created September 11, 2012 16:23
tag pairs variable helper count
{{ gallery }}
{{ if count < "6" }}
{{ img }} (1 through 5)
{{ else }}
{{ img }} (6 through infinity and beyond)
@pmeissner
pmeissner / gist:3750017
Created September 19, 2012 14:36
override the global redactor settings
fields:
spa_packages_grid:
display: Spa Packages
type: grid
fields:
spa_packages_title:
display: Title
type: text
spa_packages_body:
@pmeissner
pmeissner / gist:4166200
Created November 29, 2012 01:41
statamic semi-relationship
<h2><i>by</i> {{ categories_url_list }}</h2>
{{ entries:listing folder="about/staff" limit="1" conditions="title:{ categories_list }"}}
<a href="#" class="pull-left">
{{ image src="{{ staff_image }}" dim="150x300" }}
<img src="{{ image_url }}" width={{ width }} height={{ height }} alt="{{ title }}" class="thumbnail" />
{{ /image }}
</a>
<div class="media-body">
{{ content }}
<div><a class="email" href="mailto:{{ staff_email }}">{{ staff_email }}</a></div>
@pmeissner
pmeissner / default.jade
Last active December 17, 2015 07:48
Jade Template for Statamic
doctype
//if lt IE 7
html.no-js.lt-ie9.lt-ie8.lt-ie7
//if IE 7
html.no-js.lt-ie9.lt-ie8
//if IE 8
html.no-js.lt-ie9
//[if gt IE 8]><!
html.no-js
//<![endif]
@pmeissner
pmeissner / gist:5912094
Created July 2, 2013 19:03
statamic gitignore
.sass-cache
_logs/*
_cache/*
_config/users/*
_content/*
assets/*
# Compiled source #
###################
*.com
@pmeissner
pmeissner / gist:6149980
Created August 4, 2013 10:31
blog template in jade
{{ if segment_2 }}
h2.blog-title: a(href="../blog", title="blog") In the Loupe
article.blog-article(itemscope itemtype="http://schema.org/Article")
header.blog-article__header
h1.blog-article__title(itemprop="name") {{ title|widont }}
.blog-article__featured-image
@pmeissner
pmeissner / layout.jade
Created August 15, 2013 17:04
Wireframe layout template file.
- var site_url = 'https://s3.amazonaws.com/creative_loupe/website/demos/wireframing'
- var site_name = 'Wireframing Inc'
- var layout = ''
- var section = ''
- var sidebar_content = ''
block vars
doctype
//if IE 8
@pmeissner
pmeissner / index.jade
Created August 15, 2013 17:15
Press page
block vars
- var page_name='Press'
- var slug='press'
- var section='about'
- var layout='left-sidebar'
extends ../../layout
mixin articles
article