Skip to content

Instantly share code, notes, and snippets.

View tobyink's full-sized avatar
🦈
hi

Toby Inkster tobyink

🦈
hi
View GitHub Profile
@tobyink
tobyink / 00-http.html
Created November 17, 2010 10:12 — forked from mamund/00-http.html
Describing HTTP Requests and Reponses in RDFa
<html
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:http="http://www.w3.org/2006/http#"
xmlns:cnt="http://www.w3.org/2008/content#">
<head>
<title>Example of HTTP in RDFa</title>
<style type="text/css">
div[typeof="http:Request"]
{
border: 1px solid black;
@tobyink
tobyink / pattern-ok.diff
Created October 18, 2011 15:37
Test::RDF patch
diff -urN Test-RDF-0.22/lib/Test/RDF.pm Test-RDF-0.23/lib/Test/RDF.pm
--- Test-RDF-0.22/lib/Test/RDF.pm 2011-04-01 22:51:12.000000000 +0100
+++ Test-RDF-0.23/lib/Test/RDF.pm 2011-10-13 10:46:02.477025390 +0100
@@ -8,10 +8,10 @@
use RDF::Trine::Parser;
use RDF::Trine::Model;
use RDF::Trine::Graph;
+use Scalar::Util qw/blessed/;
use base 'Test::Builder::Module';
@tobyink
tobyink / debian-unstable-module-versions.pl
Created June 26, 2012 21:56
Based in SHARYANTO's script, but adds version numbers to the output.
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Data::Dump qw(dump);
use File::Slurp;
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
use JSON;
package returning;
use 5.008001;
use strict;
BEGIN {
$returning::AUTHORITY = 'cpan:TOBYINK';
$returning::VERSION = '0.001';
}
package returning;
use 5.008001;
use strict;
BEGIN {
$returning::AUTHORITY = 'cpan:TOBYINK';
$returning::VERSION = '0.001';
}
#!/usr/bin/env perl
use HTML::HTML5::Microdata::Parser;
use LWP::Simple 'get';
use RDF::Query;
my $uri = "http://buzzword.org.uk/2012/schema-org.html";
my $microdata = HTML::HTML5::Microdata::Parser->new(
get($uri),
$uri,
#!/usr/bin/env perl
use HTML::HTML5::Microdata::Parser;
use LWP::Simple 'get';
use RDF::Query;
my $uri = "http://helion.pl/";
my $microdata = HTML::HTML5::Microdata::Parser->new(
get($uri),
$uri,
@tobyink
tobyink / catchable-warning.pl
Created August 8, 2012 20:26
compile-time versus run-time fatal warnings
use 5.010;
use warnings FATAL => qw(all);
eval { "x" + 1 } or warn "Caught error: $@\n";
use 5.014;
use Data::Dumper;
package Foo {
use Moose;
sub bar { ... }
}
print Dumper [ Foo->meta->get_method_list ];
print Dumper [ Foo->new->meta->get_method_list ];
@tobyink
tobyink / Trine_Statements.pm
Created August 26, 2012 19:40
proof of concept for Moosey refactoring of part of RDF::Trine
use 5.014;
use Throwable::Error;
{
package Trine::Role::Node;
use Moose::Role;
requires 'sse';
requires 'from_sse';
requires 'type';
sub is_node { 1 }