Skip to content

Instantly share code, notes, and snippets.

View melvincarvalho's full-sized avatar
💭
I may be slow to respond.

Melvin Carvalho melvincarvalho

💭
I may be slow to respond.
View GitHub Profile
if (preg_match('/^post$/i', $_SERVER['REQUEST_METHOD']))
{
// logger('/home/foaf/www/datawiki/post.log', $webid, $username);
include_once('arc/ARC2.php');
/* configuration */
$config = array(
// no config needed for now
);
if (preg_match('/^post$/i', $_SERVER['REQUEST_METHOD']))
{
// logger('/home/foaf/www/datawiki/post.log', $webid, $username);
include_once('arc/ARC2.php');
/* configuration */
$config = array(
// no config needed for now
);
$().rdf().databank.dump({format:'application/rdf+xml', serialize: true})
rapper -i rss-tag-soup -o rdfxml "http://twitter.com/statuses/user_timeline/14208503.rss" | roqet -D /dev/stdin -e "SELECT DISTINCT ?p WHERE { ?s ?p ?o }"
2>/dev/null curl http://esw.w3.org/SparqlEndpoints | grep -A6 '^<tr>$' | awk '{ i++ ; if (i==3 ) print $0 " ." ; if (i==1) print "\n<#endpoint" p++ ">\n" $0 " ;" ; if ( $1 == "<tr>" ) i = 0; }' | sed 's/<td> <b>/<dct:description> /' | sed 's/<.td><td>/<void:sparqlEndpoint> /' | sed 's/<void.*href="\([^"]*\).*/<void:sparqlEndpoint> <\1> ./' | sed 's/<dct:description>.*">\(.*\)<.a.*/<dct:description> "\1" ;/'
<?php
function getAuthFromDelegatedFOAFSSL() {
/*
* Settings for the IdP. The following two variables may change with
* another IdP.
*/
$sigalg = "rsa-sha1";
$idp_certificate = "foafssl.org-cert.pem";
git clone git://github.com/melvincarvalho/libAuthentication.git
cat > index.php
<?php
require_once('libAuthentication/lib/Authentication.php');
$auth = new Authentication_FoafSSLDelegate();
if (!$auth->isAuthenticated()) { ?>
Run the following commands from a shell to be up and running with a FOAF+SSL service. No external libraries or configuration is required.
Nor is HTTPS required. If you are not running on localhost, replace that with the name of your server.
git clone git://github.com/melvincarvalho/libAuthentication.git
cat > index.php
<?php
require_once('libAuthentication/lib/Authentication.php');
@melvincarvalho
melvincarvalho / xhrput
Created September 27, 2011 16:49
XHR Put
xhr = new XMLHttpRequest();
xhr.open('PUT', 'https://melvincarvalho.data.fm/test5', false);
xhr.setRequestHeader('Content-Type', 'text/turtle; charset=UTF-8');
xhr.send('@prefix rdf: <http://www.w3.org/1999/02/22/rdf-syntax-ns#>.\n\n<#a> <#b> <#c>.');
@melvincarvalho
melvincarvalho / data fm default meta
Created October 4, 2011 20:27
data fm default meta
<#Default>
<http://www.w3.org/ns/auth/acl#agentClass> <http://xmlns.com/foaf/0.1/Agent> ;
<http://www.w3.org/ns/auth/acl#accessTo> <http://data.melvin.me> ;
<http://www.w3.org/ns/auth/acl#defaultForNew> <http://data.melvin.me> ;
<http://www.w3.org/ns/auth/acl#mode> <http://www.w3.org/ns/auth/acl#Read>, <http://www.w3.org/ns/auth/acl#Write> .