Skip to content

Instantly share code, notes, and snippets.

View lluchs's full-sized avatar

Lukas Werling lluchs

  • Karlsruhe, Germany
View GitHub Profile
@lluchs
lluchs / html5.php
Created August 9, 2012 12:10
HTML Purifier definition for some HTML5 tags
<?php
// http://developers.whatwg.org/sections.html
$def->addElement('section', 'Block', 'Flow', 'Common');
$def->addElement('nav', 'Block', 'Flow', 'Common');
$def->addElement('article', 'Block', 'Flow', 'Common');
$def->addElement('aside', 'Block', 'Flow', 'Common');
$def->addElement('header', 'Block', 'Flow', 'Common');
$def->addElement('footer', 'Block', 'Flow', 'Common');
@lluchs
lluchs / links.rb
Created November 3, 2012 17:02
Convert Windows-.lnk files to symlinks
@lluchs
lluchs / prism-map.js
Created December 21, 2012 23:34
Prism highlighting definition for Clonk maps (http://www.clonk.de/docs/en/sdk/scenario/MapCreatorS2.html)
Prism.languages.map = {
'comment': {
pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,
lookbehind: true
},
'keyword': /\b(map|overlay|point)\b/g,
'property': /\b(mat|tex|x|y|wdt|hgt|algo|zoomX|zoomY|ox|oy|a|b|turbulence|rotate|invert|seed|loosebounds|mask|grp|sub|lambda)\b/g,
'attr-name': /\b(solid|random|checker|bozo|sin|boxes|rndchecker|lines|border|mandel|rndall|script|poly)\b/g,
'number': /\b-?\d+(%|px\b|\b)/g,
'operator': /&amp;|\||\^|=/g,
; Full Screen Window
^+a::
WinSet, Style, -0xC00000,a ; remove the titlebar and border(s)
WinMove, a, , 0, 0, 1280, 1024 ; move the window to 0,0 and resize it
return
@lluchs
lluchs / dltrack.js
Created July 6, 2013 15:47
Tracks downloads via GA events.
/* Downloads tracking */
jQuery(function() {
var dlr = /\.(?!html?|php)(\w{1,4})$/
jQuery('a').click(function() {
var m
if (typeof(ga) == 'function' && (m = dlr.exec(this.href))) {
ga('send', 'event', 'download', m[1], this.href)
}
})
@lluchs
lluchs / in3
Last active January 4, 2016 13:59
asst5-page-replacement
0 1 1 0 1 4 1 6 1 1 8 5 5 7 0 0 3 15 12 6 1 10 20 11 8 24 23 3 18 22 6 3 32 26 12 9 12 3 37 12 39 41 21 23 38 34 30 1 16 34 29 8 24 6 3 47 12 19 33 31 31 11 50 38 25 64 1 8 39 4 47 69 67 52 50 63 2 20 32 76 49 55 11 67 5 73 25 4 29 76 60 79 15 5 47 81 82 24 28 96 45 39 24 29 54 28 13 17 29 10 88 87 16 73 42 65 23 7 28 23 76 27 121 38 106 4 61 85 28 6 31 55 18 17 93 63 112 15 131 90 23 129 86 9 20 99 20 80 48 131 98 63 1 48 94 131 63 144 66 149 31 73 0 95 14 154 17 88 28 111 63 141 67 121 112 91 7 114 18 63 39 69 18 70 145 15 82 109 73 61 95 113 55 147 144 123 162 127 87 156 50 123 17 89 162 59 123 51 66 41 51 126 148 128 28 72 140 31 106 18 13 209 100 88 201 223 16 222 94 10 221 8 119 168 105 107 65 193 23 206 70 121 108 132 208 211 79 20 189 53 73 158 0 114 161 151
@lluchs
lluchs / API.cpp
Last active January 4, 2016 15:19
ArgoUML-Export
#include "API.h"
namespace APIPackage-- {
void API::API()
// don't delete the following line as it's needed to preserve source code of this autogenerated element
// section 127-0-0-1--24a8b1be:142d267687f:-8000:0000000000000BDD begin
@lluchs
lluchs / keybase.md
Created July 15, 2014 19:45
Keybase proof

Keybase proof

I hereby claim:

  • I am lluchs on github.
  • I am luchs (https://keybase.io/luchs) on keybase.
  • I have a public key whose fingerprint is 1487 D617 520E 799D FC7D A2E7 9E0C A84A D471 92E5

To claim this, I am signing this object:

@lluchs
lluchs / imagus.json
Last active August 29, 2015 14:10
Imagus sieve definition for mwforum attachments
{
"mwforum": {
"link": "/attach_show.pl\\?aid=\\d+$",
"res": ":\nreturn new DOMParser().parseFromString($._, 'text/html').querySelector('.ims > img').src"
}
}
@lluchs
lluchs / nginx-uberspace.md
Last active January 3, 2020 18:14
nginx auf dem Uberspace

nginx auf dem Uberspace

Installation

Lade die neueste "mainline"-Version (hier 1.7.9) von http://nginx.org/en/download.html herunter und entpacke sie:

$ wget http://nginx.org/download/nginx-1.7.9.tar.gz 
$ tar xf nginx-1.7.9.tar.gz