Skip to content

Instantly share code, notes, and snippets.

Avatar
🐈
~=[,,_,,]:3

Jeroen De Dauw JeroenDeDauw

🐈
~=[,,_,,]:3
View GitHub Profile
View Q1.ttl
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix wikibase: <http://wikiba.se/ontology#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix schema: <http://schema.org/> .
@prefix cc: <http://creativecommons.org/ns#> .
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
View foo.md
$standardUser = $this->getTestUser();
$standardUser = $this->getTestUser();
$standardUser = $this->getTestUser();
$standardUser = $this->getTestUser();
View gnd-doku.json
{
"fields": {
"P58": {
"label": "Person – preferred name",
"description": "GND data field for the preferred name of a person or a family",
"aliases": [
"PICA+ 028A",
"PICA3 100",
"MARC 21 100"
],
View rebuildWikibaseIdCounters.sql
-- By Jeroen De Dauw / https://Professional.Wiki
-- License: GPL-2.0-or-later
SELECT * FROM /*_*/wb_id_counters;
REPLACE INTO /*_*/wb_id_counters VALUE((SELECT COALESCE(MAX(CAST(SUBSTRING(`page_title`, 2) AS UNSIGNED)), 0) FROM `page` WHERE `page_namespace` = 120), 'wikibase-item');
REPLACE INTO /*_*/wb_id_counters VALUE((SELECT COALESCE(MAX(CAST(SUBSTRING(`page_title`, 2) AS UNSIGNED)), 0) FROM `page` WHERE `page_namespace` = 122), 'wikibase-property');
SELECT * FROM /*_*/wb_id_counters;
@JeroenDeDauw
JeroenDeDauw / CreateItem.php
Created Dec 27, 2020
Maintenance script to create a Wikibase Item
View CreateItem.php
<?php
namespace Wikibase\Repo\Maintenance;
use Maintenance;
use User;
use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Entity\Item;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\Lib\WikibaseSettings;
View installMediaWiki.sh
#! /bin/bash
MW_BRANCH=$1
EXTENSION_NAME=$2
wget https://github.com/wikimedia/mediawiki/archive/$MW_BRANCH.tar.gz -nv
tar -zxf $MW_BRANCH.tar.gz
mv mediawiki-$MW_BRANCH mediawiki
View Maps.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View EntityRevisionLookup.php
<?php
interface EntityRevisionLookup {
public function getLatestRevisionId( EntityId $entityId, RevisionLookupResultHandler $resultHandler ): void;
}
// Interface version
// Great if you have anonymous classes
View LatestRevisionIdResult.php
<?php
class Result {
// Static constructors
public function isRedirect(): bool {
}
View DonationEvents.php
<?php
class DonationEvents {
private $donationCreatedCallbacks = [];
private $lolCatAddedCallbacks = [];
public function onDonationCreated( callable $callback ) {
$this->donationCreatedCallbacks[] = $callback;
}