Skip to content

Instantly share code, notes, and snippets.

View quis's full-sized avatar

Chris Hill-Scott quis

View GitHub Profile
@quis
quis / map.js
Last active August 29, 2015 14:04
/*
USAGE:
<div class="onMap" style="padding-top: 80%" data-route-to=""><img src="photo.jpg" /></div>
Where data-route-to is an encoded polyline that you can get from the Google Maps XML API, e.g.
https://maps.googleapis.com/maps/api/directions/xml?origin=marrakech%20airport&destination=merzouga
(look for the data inside <overview_polyline><points>
@quis
quis / gist:efbac0338930efece675
Created September 25, 2014 10:15
Prototype Gruntfile snippet
grunt.registerTask('production', [
'copy:govuk_template',
'copy:govuk_frontend_toolkit',
'copy:assets_js',
'copy:toolkit_js',
'bower',
'convert_template',
'copy:govuk_frontend_toolkit',
'replace',
'sass',
@quis
quis / 1-route.png
Last active August 29, 2015 14:07
Morocco planning
1-route.png
@quis
quis / Screen Shot 2014-12-04 at 21.06.15.png
Last active August 29, 2015 14:10
Demonstrating rebasing and no-fast-forward merges in git
Screen Shot 2014-12-04 at 21.06.15.png
@quis
quis / gist:abd281ef8737c7215824
Last active August 29, 2015 14:19
Pyrenees packing list
TAIL PACK
---------------------------------------
Tarp
Groundsheet
Pegs
Camera charger/batteries
Running shoes
Head torch
2.5L fuel can
@quis
quis / gist:a94126ce35a7b1b24ac9
Created June 24, 2015 16:29
Branching questions in express prototype
var bodyParser = require("body-parser");
app.use(bodyParser.urlencoded({ extended: false }));
var pages = [
{
next: {
yes: 1,
no: 4
}
},
<?
// Post category listing with support for exclusion
// $separator is a string, $excluded is an array of category slugs to be excluded from the list
// Sample call:
// echo the_category_exclude(" &middot; ", array("hidden", "admin"));
function get_the_category_exclude($separator, $excluded = array("")) {
foreach (
// =============================================
//
// SCALE ELEMENTS TO FIT A FIXED CONTAINER SIZE
// ---------------------------------------------
//
// By Chris Hill-Scott 2009-10
//
// Code is public domain, reuse as desired
//
// Requires jQuery
<?
/*
Plugin Name: quis.cc inline images
Plugin URI: http://quis.cc
Description: Embed an image post inside a text post
Version: 0.1
Author: Chris Hill-Scott
Author URI: http://quis.cc
License: GPL2
(function preloadImages() {
for (i in arguments) {
(new Image()).src = arguments[i];
}
}("image1.png", "image2.png"));