Skip to content

Instantly share code, notes, and snippets.


Barnaby Walters barnabywalters

View GitHub Profile
barnabywalters / opd.js
Last active Dec 21, 2015
Original Post Discovery minimal client side implementation. Requires promisejs (HTTP) and bean (events)
View opd.js
// Original post discovery (in progress)
var noteForms = document.querySelectorAll('.note-post-form');
if (noteForms.length > 0) {
for (var i = 0;i < noteForms.length;i++) {
var form = noteForms[i];
var inReplyToField = form.querySelector('.in-reply-to');
bean.on(inReplyToField, 'blur', function(event) {
var url =;
// TODO: Start loading indicator
promise.get('/services/original-post', {'url': url}).then(function (error, text, xhr) {
barnabywalters / notes.web
Last active Dec 20, 2015
Rough ideas for a gherkin-like environment for writing web applications. Things in parentheses are comments. `do some name` triggers the 'some name' signal defined by `on some name`
View notes.web
on GET /notes
fetch the 20 most recent notes filtered by tag
show as h-feed
on GET /notes/new
the user must be an admin
show autofilled note-form
on GET /notes/{id}
fetch note
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 class="h-thing">
<span class="p-content">&lt; Things &gt; &amp;</span>
View gist:5480962
"alternates": [
"url": "",
"rel": "home",
"media": "screen",
"hreflang": "en"
View UriMatcher.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 template.php
$render = function ($_path, $data) {
require $_path;
$render($_path, $data);
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.
width: 100%;
You can’t perform that action at this time.