Skip to content

Instantly share code, notes, and snippets.

View jonnybarnes's full-sized avatar
:octocat:

Jonny Barnes jonnybarnes

:octocat:
View GitHub Profile
@jonnybarnes
jonnybarnes / gist:8714599
Created January 30, 2014 17:55
A sample Post to my API
POST /api/post HTTP/1.1
Host: domain.com
Authoirzation: Bearer xxxxxxx
h-entry
&content=URL+encoded+string
&syndication=twitter.com
@jonnybarnes
jonnybarnes / gist:9096326
Created February 19, 2014 16:58
webmention target checking
<?php
echo '<pre>';
$mfJSON = '{
"items": [
{
"type": [
"h-as-note",
"h-entry"
],
<?php
include('../vendor/mf2/mf2/Mf2/Parser.php');
use \Mf2;
$html = file_get_contents('http://localhost/notes-id.html');
$mfJSON = new \Mf2\parse($html);
<?php
try {
$content = $this->getContent($source);
} catch (Exception $e) {
$response = Response::make('There was an error getting the content', 400);
return $response;
}
$mf = \Mf2\parse($content, $baseurl);
print_r($mf);
<?php
echo "Content: $content\n";
echo "baseURL: $baseurl\n";
$mf = \Mf2\parse($content, $baseurl);
print_r($mf);
?>
Content: <!DOCTYPE html>
<html>
<head>
[Desktop Entry]
Name=Devilspie
GenericName=Devilspie
Exec=/usr/bin/devilspie
@jonnybarnes
jonnybarnes / gist:9509247
Created March 12, 2014 15:30
Webmentions pseudocode
1. Check that both a target and source value has been sent with the mention
2. Parse target URL and check it actually points to something on my site
3. Attempt to get the content from source
4. Check if any of my saved webmentions are from this source already
5. If so check the saved webmentions has the same target (someone's note could mention two of my notes for example)
@jonnybarnes
jonnybarnes / gist:57c6b2d914057e0060e6
Last active August 29, 2015 14:01
images.luxagraf.net TLS
openssl s_client -connect images.luxagraf.net:443 -servername images.luxagraf.net -CAfile /Users/jonny/cacert.pem
CONNECTED(00000003)
depth=2 C = IL, O = StartCom Ltd., OU = Secure Digital Certificate Signing, CN = StartCom Certification Authority
verify return:1
depth=1 C = IL, O = StartCom Ltd., OU = Secure Digital Certificate Signing, CN = StartCom Class 1 Primary Intermediate Server CA
verify return:1
depth=0 description = t7IhYQZ6Qdx4ntox, C = US, CN = images.luxagraf.net, emailAddress = postmaster@luxagraf.net
verify return:1
---
Certificate chain
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'update', '-g' ]
2 info using npm@1.5.0-alpha-1
3 info using node@v0.10.29
4 verbose mapToRegistry name npm
5 verbose mapToRegistry uri https://registry.npmjs.org/npm
6 verbose mapToRegistry name gulp
7 verbose mapToRegistry uri https://registry.npmjs.org/gulp
8 verbose mapToRegistry name grunt-cli
9 verbose mapToRegistry uri https://registry.npmjs.org/grunt-cli
@jonnybarnes
jonnybarnes / PKGBUILD
Last active August 29, 2015 14:04
firefox nightly compile error
# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Nightly: Jonny Barnes <jonny@jonnybarnes.uk>
pkgname=firefox-nightly
pkgver=1
pkgrel=1
pkgdesc="Nightly version of the popular Firefox web browser"
arch=('i686' 'x86_64')
license=('MPL' 'GPL' 'LGPL')