Skip to content

Instantly share code, notes, and snippets.

@jdittrich
jdittrich / CommonJSeditorV21
Last active December 17, 2015 12:39
a script for a mediawiki Wikieditor custom dialogbox using the editor for Mediawiki Version 1.21
/* Any JavaScript here will be loaded for all users on every page load. */
/* https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization */
/* Example stuff can be seen in the /extentions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js */
/*
*/
function changeToolbar(){
if($('#wikiEditor-ui-toolbar [title="mytool"]') && $('#wikiEditor-ui-toolbar [title="Embedded file"]')){//if mytool is activated
@jdittrich
jdittrich / common.css
Created May 20, 2013 22:20
media wiki css
//hacky way: copy paste to MediaWiki:common.css
/* CSS placed here will be applied to all skins */
ul.wikieditor-toolbar-mytool-recentImagesList{
margin-left:0;
}
ul.wikieditor-toolbar-mytool-recentImagesList li{
list-style: none;
/*
For injecting additional pages in an existing jqueryMobile-Page
*/
$(function(){
(function(){
var data = $.parseJSON( $("#template-data").html());//gets the string and turns it into a JSON
var template = $("#template").html(); //gets the mustache template;
var compiledTemplate = Handlebars.compile(template); //precompilation of the template
@jdittrich
jdittrich / gist:8566984
Last active January 4, 2016 04:09
takes the array and prints out all its entrys once, in random order
/*
Copyright © 2014 jdittrich
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*/
var shuffleThis = [1,2,3,4,5,6]; //put any numbers or strings here
while(shuffleThis.length>0){
console.log(
@jdittrich
jdittrich / ExtendedTango
Last active August 29, 2015 14:05
ExtentedTango Palette for LibreOffice/OpenOffice
<?xml version="1.0" encoding="UTF-8"?>
<ooo:color-table xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ooo="http://openoffice.org/2004/office">
<!-- Black and white -->
<draw:color draw:name="Black" draw:color="#000000" />
<draw:color draw:name="White" draw:color="#ffffff" />
<!-- Tango colors -->
<!-- http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines -->
<draw:color draw:name="Tango: Butter 1" draw:color="#fce94f" />
<draw:color draw:name="Tango: Butter 2" draw:color="#edd400" />
<draw:color draw:name="Tango: Butter 3" draw:color="#c4a000" />
@jdittrich
jdittrich / TangoExtended.gpl
Created September 10, 2014 13:24
Extended Tango GIMP Palette
GIMP Palette
Name: TangoExt
#
0 0 0 Black
255 255 255 White
252 233 79 Butter 1
237 212 0 Butter 2
196 160 0 Butter 3
252 175 62 Orange 1
245 121 0 Orange 2
@jdittrich
jdittrich / gist:d9583c0b9a95b65b696f
Last active August 29, 2015 14:21
Redirect Page
<!DOCTYPE html>
<html>
<head>
<title>Untitled Document</title>
<meta charset="UTF-8">
<meta name="description" content="">
<meta name="keywords" content="">
</head>
<body>
@jdittrich
jdittrich / gist:3bcc2ce472720999e070
Created May 28, 2015 19:15
Pelican static blogging: creates a list entry with a link to the index and highlights this link. Accounts for alternative locations via INDEX_SAVE_AS
{% if DISPLAY_INDEX_ON_PAGES_MENU %}
<li class="pure-menu-item{% if page_name == 'index' or page_name~".html" == INDEX_SAVE_AS %} active{% endif %}"><a class="pure-menu-link" href="{{ SITEURL }}/{% if INDEX_SAVE_AS %}{{INDEX_SAVE_AS}}{% else %}/{% endif %}">
Blog
</a></li>
{% endif %}
javascript:function htmlreplace(a,b,element){if(!element)element=document.body;var nodes=element.childNodes;for(var n=0;n<nodes.length;n++){if(nodes[n].nodeType==Node.TEXT_NODE){nodes[n].textContent=nodes[n].textContent.replace(new RegExp(a,'gi'),b);}else{htmlreplace(a,b,nodes[n]);}}}htmlreplace('bro','fam');
@jdittrich
jdittrich / gist:78350f0e5ead23d9dffe017c24201f73
Created July 15, 2016 18:31
autogenerated technooptimist booktitles
- Why the invention of big information will remake everything.
- What happens when the raise of big data will turn over your brain.
- How the invention of smart information will change your brain.
- How the raise of smart algorithms will change our thinking.
- What happens when the raise of virtual AI will remake IT.
- What happens when the growth of virtual AI will turn over our thinking.