Skip to content

Instantly share code, notes, and snippets.

@tomdavies
tomdavies / QUERY_PARAM.md
Created November 28, 2012 11:16 — forked from airways/QUERY_PARAM.md
ExpressionEngine: new QUERY_PARAM protocol that always works

QUERY_PARAM Protocol

This is a simple technique which should work on ALL hosts to allow ExpressionEngine to handle URLs without index.php in them. Hopefully EllisLab will add this as a built-in option soon.

IJR

@tomdavies
tomdavies / deploy-production.rb
Created November 27, 2012 12:16
Deploying ExpressionEngine 2 with Capistrano
set :deploy_to, "/var/www/default"
set :branch, 'master'
#Remote DB info
set :dbuser, ""
set :dbname, ""
set :dbhost, ""
set :dbpass, ""
@tomdavies
tomdavies / script.js
Created October 6, 2012 11:12
Yepnope / user scripting
function betaApp(){
var app = this;
this.init = function(){
app.injectYepnope('https://raw.github.com/cnkt/eksi-beta/master/ui/js/yepnope.js');
};
this.injectYepnope = function(url) {
var gp = document.createElement( 'script' );
gp.type = 'text/javascript';
gp.async = true;
gp.src = url;
@tomdavies
tomdavies / RSS Feed
Created January 24, 2012 08:44 — forked from ryanbattles/RSS Feed
RSS Feed
{!--
1. THE CHANNEL AND FIELD NAMES NEED TO BE CHECKED FOR ACCURACY
2. THE DYNAMIC LINK PATHS NEED TO BE CHECKED FOR ACCURACY
--}
{exp:rss:feed channel="news"}
<?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/"
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb
# and made a lot more robust by me
# this implementation uses erb by default. if you want to use any other template mechanism
# then replace `erb` on line 13 and line 17 with `haml` or whatever
module Sinatra::Partials
def partial(template, *args)
template_array = template.to_s.split('/')
template = template_array[0..-2].join('/') + "/_#{template_array[-1]}"
options = args.last.is_a?(Hash) ? args.pop : {}
options.merge!(:layout => false)
@tomdavies
tomdavies / flexboxtest.html
Created August 16, 2011 11:44 — forked from adactio/flexboxtest.html
Content-first flexbox test
<!DOCTYPE html>
<html>
<head>
<title>Flexbox test</title>
<style>
@media screen and (min-width: 30em) {
body {
width:100%;
display: -webkit-box;
display: -moz-box;