Skip to content

Instantly share code, notes, and snippets.

View jdlrobson's full-sized avatar

Jon Robson jdlrobson

View GitHub Profile
@jdlrobson
jdlrobson / proxy.js
Created May 9, 2018 19:23
API proxy
const express = require('express');
const wikiApis = require('express-wikimedia-api-proxy');
const app = express();
const cors = require('cors');
const PORT = 8090
const base = '/api/';
app.use(cors())
wikiApis(app, base, true);
app.listen(PORT)
@jdlrobson
jdlrobson / proxy.js
Created May 9, 2018 19:23
API proxy
const express = require('express');
const wikiApis = require('express-wikimedia-api-proxy');
const app = express();
const cors = require('cors');
const PORT = 8090
const base = '/api/';
app.use(cors())
wikiApis(app, base, true);
app.listen(PORT)
@jdlrobson
jdlrobson / CategoryOverlay.js
Created April 3, 2018 21:07
Ideas for category rewrite
const Tabs = () => {
// to be implemented but would deal with all the tab magic.
};
const Header = ( { title, actions } ) => {
// to be implemented
}
// CategoryOverlay becomes an Overlay without any async properties.
// Very easy to test and easier to tweak
{"words":{"土":"soil/earth","水":"water","山":"mountain","瓜":"melon","花":"flower","果":"fruit","苦":"bitter","西":"west","西瓜":"watermelon","苦瓜":"bitter gourd","虹":"rainbow","虫":"insect","工":"work","火山":"volcano","火":"fire","云":"cloud","萝卜":"radish","风":"wind","冬":"winter","电":"electricity","夏":"summer","桃":"peach","木":"wood","瀑":"waterfall/shower","土豆":"potato","豆":"beans/pea","苹果":"apple","茄":"eggplant","子":"son","茄子":"eggplant","星":"star","日":"sun (☀️)","生":"give birth","星期一":"monday","期":"period(time)","一":"one","星期二":"tuesday","二":"two","香蕉":"banana","香":"fragrant","饭团":"rice ball","团":"group","饭":"meal/food","杏":"apricot","口":"mouth","饼":"pastry/cake","鱼":"fish","海鲜":"seafood","海":"sea","面包":"bread","陨石":"aerolite","石":"stone","陨":"fall from sky","石榴":"pomegranate","田":"field","糕点":"pastry","饺":"dumpling","大":"big","人":"person","夫人":"madam","夫":"man","天":"sky","天人":"heaven","森":"forest","林":"in the woods","本":"foundation","玉":"jade","女":"woman/daughter","羊":"sheep","牛":"cow","白":"white","雨":"rain","士":"soldier
diff --git a/includes/BookRenderingMediator.php b/includes/BookRenderingMediator.php
index 9d30550..400aec7 100644
--- a/includes/BookRenderingMediator.php
+++ b/includes/BookRenderingMediator.php
@@ -192,10 +192,7 @@ class BookRenderingMediator implements LoggerAwareInterface {
'electron' => ElectronVirtualRestService::class,
];
foreach ( $modules as $module => $class ) {
- if ( !isset( $config['modules'][$module] ) ) {
- throw new Exception( "VirtualRESTService module $module is not configured propely" );
@jdlrobson
jdlrobson / p.diff
Created August 23, 2017 19:37
p.diff
diff --git a/includes/specials/SpecialMobileLanguages.php b/includes/specials/SpecialMobileLanguages.php
index 735645e..d30655c 100644
--- a/includes/specials/SpecialMobileLanguages.php
+++ b/includes/specials/SpecialMobileLanguages.php
@@ -22,22 +22,11 @@ class SpecialMobileLanguages extends MobileSpecialPage {
* @return array
*/
private function getLanguages() {
- $api = new ApiMain(
- new DerivativeRequest(
@jdlrobson
jdlrobson / CustomElement.html
Created August 18, 2017 17:44
CustomElement.html - autocomplete
<!DOCTYPE HTML>
<html>
<head>
<title>Custom element autocomplete</title>
</head>
<body>
<h1>CustomElement AutoComplete</h1>
<p>
Upgrades a standard select element to work like an autocomplete by using CustomElements.
It will degrade on older browsers that do not support elements to a select dropdown.
@jdlrobson
jdlrobson / CustomElement.html
Created August 18, 2017 17:44
CustomElement.html - autocomplete
<!DOCTYPE HTML>
<html>
<head>
<title>Custom element autocomplete</title>
</head>
<body>
<h1>CustomElement AutoComplete</h1>
<p>
Upgrades a standard select element to work like an autocomplete by using CustomElements.
It will degrade on older browsers that do not support elements to a select dropdown.
.reference a {
font-size: 8pt;
color: @pureBlack;
border-bottom: none;
}
.refbegin ul li,
.references li{
font-size: 10pt;
table.wikitable {
margin: 1em 0;
background-color: #FFF;
border: 1px solid #aaa;
border-collapse: collapse;
color: @pureBlack;
font-size: 10pt !important;
}
table.wikitable caption {