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 / 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 / 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 / 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)
}
})
; 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 / 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': /&|\||\^|=/g,
@lluchs
lluchs / links.rb
Created November 3, 2012 17:02
Convert Windows-.lnk files to symlinks
@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 / embed.js
Created July 29, 2012 10:45
Local project page viewer for CCF
$('head').append('\
<link href="http://clonkforge.net/style/clonkforge.css" type="text/css" rel="stylesheet"/>\
<link href="http://clonkforge.net/style/text.css" type="text/css" rel="stylesheet"/>\
<link href="http://clonkforge.net/style/admin.css" type="text/css" rel="stylesheet"/>\
<link rel="stylesheet" type="text/css" href="http://clonkforge.net/style/markitup/style.css"/>\
<link href="http://clonkforge.net/style/lytebox.css" type="text/css" rel="stylesheet"/>\
<link href="style.css" type="text/css" rel="stylesheet"/>\
<link href="http://clonkforge.net/includes/js/codemirror/codemirror.css" type="text/css" rel="stylesheet"/>\
<link href="http://clonkforge.net/includes/js/codemirror/theme/default.css" type="text/css" rel="stylesheet"/>\
')
@lluchs
lluchs / tabdemo.html
Created July 19, 2012 19:54
CSS tabs
<!doctype html>
<title>Tabs!</title>
<style>
p {
display: none;
}
p#tabs, p:target {
@lluchs
lluchs / io.go
Created June 27, 2012 13:02
Automatic github downloader
package main
import "io"
import "time"
func copySleep(dst io.Writer, src io.Reader, delay int, progress func(written int64)) (written int64, err error) {
// If the writer has a ReadFrom method, use it to do the copy.
// Avoids an allocation and a copy.
if rt, ok := dst.(io.ReaderFrom); ok {
return rt.ReadFrom(src)