Skip to content

Instantly share code, notes, and snippets.

View dirkkelly's full-sized avatar

Dirk Kelly dirkkelly

View GitHub Profile
@dirkkelly
dirkkelly / gist:1045174
Created June 24, 2011 16:40
madison products
{% paginate products.all.order_by_max_price_asc.search by 15 %}
<ol>
<li><ol>
{% for product in paginate.collection %}
<li>
@dirkkelly
dirkkelly / gist:1014266
Created June 8, 2011 11:43
product groups
{% for field in products.all.product_group_fields.style %}
{% for style in field.field_values %}
<li><a href="/wines?style={{style.value}}">{{ style.value }}</a></li>
{% endfor %}
{% endfor %}
@dirkkelly
dirkkelly / gist:945910
Created April 28, 2011 06:36
product_types.liquid
{% extends 'parent' %}
{% block body %}
{% for wine in contents.wines %}
<a href="/all_of_our_wines/{{wine._permalink}}">{{wine.title}}</a>
{% endfor %}
{% for shirt in products.shirts %}
<a href="/all_of_our_shirts/{{shirt._permalink}}">{{wine.title}}</a>
{% endfor %}
@dirkkelly
dirkkelly / gist:945918
Created April 28, 2011 06:41
product_template.liquid
We couldn’t find that file to show.
@dirkkelly
dirkkelly / gist:943585
Created April 27, 2011 01:52
.bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
vc_dirty_marker="✘"
prompt_designator_symbol="»"
prompt_designator_alternate="…"
_prompt_colour() {
echo -n '\['
if [[ "$1" = default ]]; then
echo -n "\\e[0m"
@dirkkelly
dirkkelly / 1) contact.liquid
Created March 15, 2011 00:34
Example Contact Form
{% block enquiry %}
<form id="enquiry_form" action="{{ contents.enquiries.api.create }}" method="post">
{% editable_long_text 'welcome' %}
<h3>Got an enquiry?</h3>
<p>Please fill in the form below and we will get in touch as soon as possible.</p>
{% endeditable_long_text %}
<fieldset>
<div id="error_message">No Errors</div>
<ol>
<li>
require 'rubygems'
require 'bundler/setup'
require 'bundler/capistrano'
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :rvm_ruby_string, 'ree-1.8.7@bluenail' # Or whatever env you want it to run in.
set :rvm_type, :system
set :user, "dk"
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
{% include 'head' %}
</head>
<body class="{{ page.slug }}">
@dirkkelly
dirkkelly / dynamic form fields
Created January 13, 2011 00:06
setting up dynamic form fields in the radiant-forms-extension
something_awesome:
extension: mail
field:
from: contact[email]
recipients: info@company.com
<form>
<input name="contact[email]" />
</form>
@dirkkelly
dirkkelly / version.rb
Created December 29, 2010 03:44
Using 2.3.x named_scopes for @mariovisic drafting question
class Version
named_scope :drafts, :conditions => { :draft => true }
named_scope :published, :conditions => { :draft => false }
end
Version.drafts # all drafts
Version.published # all published