Skip to content

Instantly share code, notes, and snippets.

@andylolz
andylolz / .block
Last active November 8, 2023 14:21 — forked from mbostock/.block
IATI traceability
license: gpl-3.0
@andylolz
andylolz / mapping-validator-updates.xsd
Created September 18, 2021 11:12
An XSD for validating the updated mapping.xml file (i.e. including validation-rules)
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<xsd:element name="mappings">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="mapping" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
@andylolz
andylolz / mapping.xsd
Created September 16, 2021 07:38
A minimal XSD for validating the mapping.xml file in http://github.com/IATI/IATI-Codelists
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<xsd:element name="mappings">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="mapping" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
@andylolz
andylolz / Student.php
Created October 14, 2012 23:36
Fun extending the User model. This is my solution to the problem I posted here: http://gist.github.com/3885906 Thanks to Kindari on laravel IRC
<?php
class Student extends User {
public function reports() {
// I know I said the relationship here is one-to-one..!
// But I don't mind hacking this too much.
return $this->has_many('Report', 'student_id');
}
}
{
"@context": "http://schema.org",
"@type": "ClaimReview",
"identifier": "50c9b383-291d-495f-b75c-10516a819db0",
"datePublished": "2020-08-26",
"dateModified": "2020-08-26",
"description": "The paper, which was retracted days after it was published, did not prove any link between 5G and coronaviruses.",
"url": "https://fullfact.org/online/facebook-retracted-paper/",
"author": {
"@type": "Organization",
<!DOCTYPE html>
<html>
<head>
@andylolz
andylolz / gist:e1cbf97e996910e524be
Created April 21, 2015 16:52
Westminster constituency data, including example postcodes
{
"65642": {
"codes": {
"gss": "E14000847",
"unit_id": "24722"
},
"name": "North Herefordshire",
"country": "E",
"type_name": "UK Parliament constituency",
"example_postcode": "HR7 4LX",
@andylolz
andylolz / active_v1_data.ipynb
Created May 15, 2019 11:21
Some stats on v1.0x data, using iatikit. Stats generated 15 May 2019.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andylolz
andylolz / assange.xml
Last active May 6, 2019 06:24
Parse the wikileaks transcript of a meeting between Julian Assange and Eric Schmidt into the Akoma Ntoso format, in order to import it into SayIt (https://github.com/mysociety/sayit)
<akomaNtoso>
<debate name="Transcript of secret meeting between Julian Assange and Google CEO Eric Schmidt">
<meta>
<references source="#">
<TLCPerson id="SC" href="/ontology/person/SC" showAs="Scott Malcomson" />
<TLCPerson id="JC" href="/ontology/person/JC" showAs="Jared Cohen" />
<TLCPerson id="JA" href="/ontology/person/JA" showAs="Julian Assange" />
We can't make this file beautiful and searchable because it's too large.
timestamp,action,url,person,comment
"Nov. 28, 2014, 3:36 p.m.",person-update,,,Did a bit of googling.
"Dec. 7, 2014, 4:46 p.m.",candidacy-create,/person/3511,David Chappell,http://davidchappell.org.uk/en/
"Dec. 7, 2014, 4:50 p.m.",person-update,/person/3511,David Chappell,http://davidchappell.org.uk
"Jan. 15, 2015, 11:30 p.m.",person-update,/person/802,Anthony Ridge-Newman,http://ridgenewman.blogspot.co.uk
"Jan. 15, 2015, 11:49 p.m.",person-update,,,Standing in Shrewsbury and Atcham instead: https://shrewsburylibdems.wordpress.com/christine-tinker/
"Jan. 15, 2015, 11:56 p.m.",person-update,/person/2217,Andrew Illsley,http://alittlebitofstone.com/2015/01/15/ukip-selects-candidate-for-general-election/
"Jan. 16, 2015, 12:20 a.m.",person-update,,,https://shrewsburylibdems.wordpress.com/christine-tinker/
"Jan. 16, 2015, 12:26 a.m.",person-update,/person/1050,Christopher Warleigh-Lack,twitter.com
"Jan. 16, 2015, 12:37 a.m.",person-update,/person/2148,Emma Reynolds,http://news.bbc.co.uk/democracylive/hi/representat