Skip to content

Instantly share code, notes, and snippets.

View JeroenDeDauw's full-sized avatar
🐈
~=[,,_,,]:3

Jeroen De Dauw JeroenDeDauw

🐈
~=[,,_,,]:3
View GitHub Profile
-- 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;
@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#> .
$standardUser = $this->getTestUser();
$standardUser = $this->getTestUser();
$standardUser = $this->getTestUser();
$standardUser = $this->getTestUser();
{
"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"
],
@JeroenDeDauw
JeroenDeDauw / CreateItem.php
Created December 27, 2020 15:36
Maintenance script to create a Wikibase Item
<?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;
#! /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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
interface EntityRevisionLookup {
public function getLatestRevisionId( EntityId $entityId, RevisionLookupResultHandler $resultHandler ): void;
}
// Interface version
// Great if you have anonymous classes
<?php
class Result {
// Static constructors
public function isRedirect(): bool {
}
<?php
class DonationEvents {
private $donationCreatedCallbacks = [];
private $lolCatAddedCallbacks = [];
public function onDonationCreated( callable $callback ) {
$this->donationCreatedCallbacks[] = $callback;
}