Skip to content

Instantly share code, notes, and snippets.

Barnaby Walters barnabywalters

Block or report user

Report or block barnabywalters

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@barnabywalters
barnabywalters / .gitignore
Last active Aug 29, 2015
An attempt at making a Composer-compatible repository in a gist
View .gitignore
.DS_Store
composer.phar
/vendor/
@barnabywalters
barnabywalters / h-event.html
Created May 4, 2014
php-mf2 dt-* <data class="value"> parse demonstration
View h-event.html
<div class="h-event">
<span class="dt-start">
<data class="value" value="2013-01-01">first day of 2013</data> at
<data class="value" value="21:00">nine in the evening</data>
</div>
@barnabywalters
barnabywalters / authorization.php
Last active Aug 29, 2015
indieauth client/server setup code
View authorization.php
<?php
// Create a micropub client app — allows users to log in and authorize this app to make requests on their behalf to,
// e.g. a micropub endpoint, authenticates requests based on remember-me cookie.
// $dataToCookie and $dataFromCookie map between the array of information about the current user and the string value
// stored in the remember-me cookie
//
// Adds routes:
// /login
// /authorize
@barnabywalters
barnabywalters / note.yaml
Created Jun 8, 2014
Example YAML of one of my notes
View note.yaml
id: 4DtGgd
author:
type: h-card
url: 'http://waterpigs.co.uk'
photo: 'http://photos.waterpigs.co.uk/photos/custom/201210/5d5a4d-Facing-Down_100x100xCR.jpg'
name: 'Barnaby Walters'
name: 'Just added some more tunes to http://www.waterpigs.co.uk/wpsm/ — As far as I can tell, it''s the largest collection of hurdy gurdy sheet music on the web! #folkmusic #hurdygurdy #abc'
content: "<p>Just added some more tunes to <a class=\"auto-link\" href=\"http://www.waterpigs.co.uk/wpsm/\">http://www.waterpigs.co.uk/wpsm/</a> — As far as I can tell, it's the largest collection of hurdy gurdy sheet music on the web! <a rel=\"tag\" href=\"/tags/folkmusic\">#folkmusic</a> <a rel=\"tag\" href=\"/tags/hurdygurdy\">#hurdygurdy</a> <a rel=\"tag\" href=\"/tags/abc\">#abc</a></p>\n"
published: '2011-09-16T16:41:38+00:00'
updated: null
View nasty-hproduct.html
<xml id="skufilterbrowse" class="slide">
<productcatalog><labels><label key="skuset.deliverypolicyurl">Delivery policy content URL</label><label key="price.save">Save</label><label key="skuset.seemoredetails">See more details</label><label key="price.additionaloffers">Additional Offers</label><label key="price.freeitem">Includes Free Item*</label><label key="price.instsaving">Instant Savings</label><label key="skuset.eddieseedetails">See details </label><label key="price.rebateurl">RebateURL</label><label key="skuset.freedelivery">FREE SHIPPING, plus 5% back for Rewards Members</label><label key="price.printableCoupons">Click here for Printable Coupon</label><label key="price.value">Value</label><label key="skuset.eddieshipdetails">Estimated to arrive no later than </label><label key="price.qty">Qty.</label><label key="price.chooseyouritems">Choose your Items</label><label key="price.true">true</label><label key="skuset.clearancemessage">&lt;strong&gt;CLEARANCE ITEM:&lt;/strong&gt; </label><label key="price
@barnabywalters
barnabywalters / style.css
Created Sep 5, 2012
em based responsive line lengths with cascading breakpoints and stuff
View style.css
/*
* The basic idea:
* No more "mobile first", just take up the entire browser width when
* optimum line length gets near viewport width.
*/
body
{
width: 100%;
}
View template.php
<?php
$render = function ($_path, $data) {
extract($data);
unset($data);
require $_path;
};
ob_start();
$render($_path, $data);
View UriMatcher.php
<?php
namespace BarnabyWalters\Rest;
use Symfony\Component\Routing\Matcher\UrlMatcher as Matcher;
/**
* UrlMatcher
*
* A subclass of Symfony’s UrlMatcher which strips the extension from incoming
View gist:5480962
{
"alternates": [
{
"url": "http://example.org",
"rel": "home",
"media": "screen",
"hreflang": "en"
}
],
"rels":
@barnabywalters
barnabywalters / input.html
Last active Dec 17, 2015
Test case for microformats-2 e-* p-* HTML injection potential security hole
View input.html
<span class="h-thing">
<span class="e-content">&lt; Things &gt; &amp;</span>
</span>
<span class="h-thing">
<span class="p-content">&lt; Things &gt; &amp;</span>
</span>
You can’t perform that action at this time.