Skip to content

Instantly share code, notes, and snippets.

View Fannon's full-sized avatar

Simon Heimler Fannon

View GitHub Profile
@Fannon
Fannon / gist:c3cac2c968de7ea320b5
Created July 26, 2014 08:20
MediaWiki Forms Width Patch
/** Semantic Forms Style **/
.formtable .createboxInput,
.formtable .mandatoryField,
.formtable textarea {
min-width: 204px;
width: 504px;
max-width: 100%;
}
.select2-choices,
@Fannon
Fannon / gist:dc6a8e9cb58ae7cd6249
Created July 26, 2014 08:40
SemanticForms.css
/**
* The main CSS file for the Semantic Forms extension.
*/
/* Override "width: 100%" setting in standard MediaWiki skins */
textarea.createboxInput {
/* width: auto;*/
}
textarea.mandatoryField {
width: auto;
@Fannon
Fannon / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
{{!-- TABLE DISPLAY --}}
{{~#if display_table~}}
{| class="wikitable formdata"
! colspan="2"|{{name}}
{{#each attr}}
|- \{{#if: \{{{ {{~@key~}} |}}} | | style="display: none;" \}}
| '''{{this.title}}'''
{{#if this.smw_arraymap~}}
| {{smw_templ_array @key}}
{{else~}}
// Once the document has finished loading, set up everything!
jQuery(document).ready(function() {
// Check if a SemanticForm is present
if ($('#sfForm').length > 0) {
jQuery('body').initializeJSElements();
jQuery('.multipleTemplateInstance').initializeJSElements(true);
jQuery('.multipleTemplateAdder').click( function() {
jQuery(this).addInstance( false );
/**
* Clean, light-grey style
* @author Simon Heimler 2015
*/
.ui-tabs .ui-tabs-panel {
padding: 4px 10px;
}
.ui-widget-header {
background: none;
}
$GLOBALS['wgHooks']['onResourceLoaderGetConfigVars'][] = 'exposeGlobalsToJavaScript';
function exposeGlobalsToJavaScript( array &$vars ) {
$vars['test_key'] = 'test_value';
die();
return true;
}
@Fannon
Fannon / JSON Schema Talk
Created May 5, 2015 11:25
JSON Schema Talk (german)
# Intro
Thema ist Daten und ihre Metadaten. Zusammengefasst:
* JSON selbst ist ein neutralen Datenformat, spezialisiert für serialisation.
* Es kann Daten oder Metadaten beinhalten.
* Metadatenformate:
** JSON Schema kann die Datenstruktur beschreiben ("type")
** JSON Schema bringt auch eine sehr einfache Semantik mit sich ("format") z.B. Email, URL
** JSON LD ist darauf spezialisiert komplexe Semantik zu erfassen (auch Zusammenhänge zwischen Datensätzen)
# JSON Schema
@Fannon
Fannon / gist:1052577fe58b347798b7
Last active August 29, 2015 14:20
JSON Schema property array notation
// JSON Schema Spec
{
properties: {
// Property order is not ensured! two could come before one, but you'd never know...
one: {
id: "1" // Which ID is it now? One or 1?
type: "string"
},
two: {
type: "string"
@Fannon
Fannon / runJobs.sh
Created June 11, 2015 10:43
runJobs.sh
while true;
do php ./maintenance/runJobs.php --procs 4 && echo '.';
sleep 3;
done