Skip to content

Instantly share code, notes, and snippets.

View Fannon's full-sized avatar

Simon Heimler Fannon

View GitHub Profile
@Fannon
Fannon / xregistry-http-structure-thoughts.md
Last active April 16, 2024 04:39
xRegistry HTTP operations structure

Idea for xRegistry spec:

  • One resource can not only have multiple versions, but also multiple documents representations of it
  • Ideally, there is just one document that is the source of truth, but other documents can be automatically derived from it
    • E.g. an API could be described with EDMX, and the OpenAPI 2, OpenAPI3 and 3.1 definitions of it are derived
    • Consumers may only support certain document description formats and would like to see which ones are available and pick the best choice to them
      • A consumer may not care which document formats are derived or original.
  • Like versions, the document formats should have a "default" fallback.
  • For server and consumer it would be easier if API operations are not polymorphic and return different responses based on a query parameter
@Fannon
Fannon / createScales.js
Created November 12, 2023 07:00
Create all modal scales from the same pattern
const halfStepPattern = [2, 2, 1, 2, 2, 2, 1]
const modes = ["Ionian", "Dorian", "Phrygian", "Lydian", "Mixolydian", "Aeolian", "Locrian"]
const notes = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"]
const notesDoubled = notes.concat(notes) // double the array to get a cheap "ring buffer"
const patternDoubled = halfStepPattern.concat(halfStepPattern)
notes.forEach((note, noteIndex) => {
modes.forEach((mode, modeIndex) => {
let currentStep = 0
@Fannon
Fannon / .js
Last active July 5, 2017 12:04
make all links open in new tab
function convertLinks() {
console.log('convertLinks()');
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++){
links[i].setAttribute('target', '_blank');
}
}
convertLinks();
// window.onload = convertLinks;
// element.addEventListener('DOMNodeInserted', convertLinks, false);
{
"appVersion":"1.9.34",
"favouriteLocations":{
},
"locationMethod":"choose",
"placeName":"Regensburg",
"longPlaceName":"Regensburg, Deutschland",
"latitude":"49.013407",
"longitude":"12.101631",
+----------+
| Object |
+----+-----+
|
|
|
+----------+
+-----+ Device +----+
| +----------+ |
| |
diff --git a/resources/src/mediawiki/mediawiki.searchSuggest.js b/resources/src/mediawiki/mediawiki.searchSuggest.js
index 7b7ccf3..22ad6c2 100644
--- a/resources/src/mediawiki/mediawiki.searchSuggest.js
+++ b/resources/src/mediawiki/mediawiki.searchSuggest.js
@@ -127,7 +127,7 @@
$.data( node, 'request', api.get( {
action: 'opensearch',
search: query,
- namespace: 0,
+ namespace: mw.config.get('wgContentNamespaces').join('|'),
Index: SemanticForms.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- SemanticForms.php (revision 8a4dad116c93e0b47b1452d903520fb3cbd7d41d)
+++ SemanticForms.php (revision )
@@ -473,6 +473,12 @@
$GLOBALS['sfgAutocompleteOnAllChars'] = false;
<?php
/**
* Version 1.1.3 (Works out of box with MW 1.7 or above)
* - Works out with MW 1.15.1 (tested)
*
* Authentication Plugin for Siteminder
* Derived from ShibAuthPlugin.php
* Much of the commenting comes straight from AuthPlugin.php
* Had to add return statements to several routines because a
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
@Fannon
Fannon / ModelExpansionExample.yaml
Last active August 29, 2015 14:24
Model Expansion Example
###################################
# Development Model #
###################################
$extend: /field/parentField
title: Field Title
type: string
format: email