Skip to content

Instantly share code, notes, and snippets.

@cole007
cole007 / 404.html
Created March 16, 2016 11:09
Please add pi.search_assistance.php to /deploy/system/expressionengine/third_party/search_assistance/pi.search_assistance.php
{layout="_layouts/_main"}
{layout:set name="extra_metas"}
<meta name="robots" value="noindex,nofollow,noarchve">
{/layout:set}
<div class="wrapper">
<div class="page__main">
<nav class="nav nav--breadcrumbs">
<ul>
<li><a href="/">Home</a></li>
@cole007
cole007 / default.vcl
Created January 27, 2016 14:39
Legacy Fussels/Forbury vcl
# /etc/varnish/default.vcl
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
vcl 4.0;
import std;
import directors;
@cole007
cole007 / paginated-entries.html
Created December 15, 2015 17:13
Paginate entries in craft by date
<!-- if no category set one as null -->
{% if category is not defined %}
{% set category = '' %}
{% endif %}
{% set date = now ~ ' 00:00:00' %}
<!-- this logic is shared across several locales so Section is defined externally to refer to the locale in question -->
{% set ids = craft.entries.section('event' ~ Section).eventDate('>= ' ~ date).relatedTo(category).limit(null).ids() %}
{% set page = 0 %}
Schindler is a handsome, broad-shouldered man with a well-educated, regelmäßigten, großflachigen face and forehead open. He is now in his forties. One believes in his eyes at times a shadow of resignation and to his mouth to perceive a train of bitterness. That makes it hard, entsagungsreiche life - he leads it, at least since 1914
===
Schindler ist ein stattlicher, breitschultriger Mann mit einem wohlgebildeten, regelmäßigten, großflachigen gesicht und offener Stirn. Er ist nun Mitte vierzig. Man vermeint in seinen Augen bisweilen einen Schatten der Resignation und um seinen Mund einen Zug der Bitterkeit wahrzunehmen. Das macht das harte, entsagungsreiche Leben - er fuhrt es zumindest seit 1914.
@cole007
cole007 / constituency-data.csv
Created June 14, 2015 21:48
Constituency boundary sizes
PCON_name ha km mi
Ross, Skye and Lochaber 1277950 12779.5 4934.18
Caithness, Sutherland and Easter Ross 875170 8751.7 3379.05
Argyll and Bute 716378 7163.78 2765.95
Inverness, Nairn, Badenoch and Strathspey 495320 4953.2 1912.44
Dumfriesshire, Clydesdale and Tweeddale 437637 4376.37 1689.73
Dumfries and Galloway 415030 4150.3 1602.44
Perth and North Perthshire 386107 3861.07 1490.77
Berwick-upon-Tweed 384261 3842.61 1483.64
West Aberdeenshire and Kincardine 327150 3271.5 1263.13
@cole007
cole007 / collection.liquid
Created June 2, 2015 13:59
Shopify sub-categories hack
{% comment %}
For our Collection page liquid template, we'd then use the following to create our navigation:
{% endcomment %}
{% assign current = collection.handle %}
{% if collection.title contains '/' %}
{% assign words = collection.title | split: '/' %}
{% assign section = words[0] | handleize %}
{% for collection in collections %}
@cole007
cole007 / app.js
Last active June 6, 2017 05:38
Shopify code samples
$(function($){
function doProducts(collection, limit) {
collection = typeof collection !== 'undefined' ? collection : 'books';
limit = typeof limit !== 'undefined' ? limit : 250;
var url = 'http://XXXX.myshopify.com/collections/' + collection + '/products.json?limit=' + limit;
return url;
}
var doFilter = function(data,min,max) {
@cole007
cole007 / index.html
Last active October 27, 2021 16:10
Shopify API filter for product prices
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>Shopify filtering Boilerplate</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="_assets/css/style.css">
</head>
<body>

Yet the Tories have spent the last five years rolling out extreme measure without a mandate polling around 25% of the electorate at the polls. No quick fix but my god they have tried their hardest to make as big an impact as fast as possible with minimal accountability except to say that 'we inherited this mess.'

That is on the back of Labour pushing a Thatcherite centre left (banks too big to fail) and debt having gone up considerably in the last five years. Just because socialism doesn't work in one country doesn't mean it will fail in all countries. The one thing that excites me about SNP is their look to the socialist left leanings of the Scandinavian countries which consistently have much higher employment, happiness index, better education outcomes, better quality healthcare (including childcare and care for the elderly) and a far more equal distribution of wealth.

But no, let's look to the failed American economic model predicated on big businesses that have failed, a property bubble that has burst