Skip to content

Instantly share code, notes, and snippets.

View tleilax's full-sized avatar

Jan-Hendrik Willms tleilax

  • Universität Oldenburg
  • Oldenburg, Germany
View GitHub Profile
@tleilax
tleilax / profile-tabs.diff
Created January 6, 2012 16:03
Stud.IP: Fix profile tabs' creation
Index: lib/navigation/ProfileNavigation.php
===================================================================
--- lib/navigation/ProfileNavigation.php (Revision 21829)
+++ lib/navigation/ProfileNavigation.php (Arbeitskopie)
@@ -92,6 +92,10 @@
$navigation = new Navigation(_('Profil'), 'about.php');
$this->addSubNavigation('view', $navigation);
+ if (!$this->show_tabs($username)) {
+ return;
@tleilax
tleilax / dabblet.css
Created January 10, 2012 17:50
Vertical table header test
/* Vertical table header test */
th {
vertical-align: bottom;
}
th.vertical, td.vertical {
display: inline-block;
text-align: center;
width: 1em; /* px tuts auch nicht*/
}
@tleilax
tleilax / get_barcode_from_image.js
Created January 12, 2012 20:47 — forked from tbtlr/get_barcode_from_image.js
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
@tleilax
tleilax / lib-classes-AlertView.php
Created January 25, 2012 19:20 — forked from luniki/lib-classes-AlertView.php
AlertView4Stud.IP (fixed template)
<?php
/*
* AlertView.php - render an alert message to the user
*
* Copyright (c) 2011 mlunzena@uos.de
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
@tleilax
tleilax / smiley.coffee
Created February 1, 2012 21:46
Stud.IP: Smiley assets in SASS / CoffeeScript
jQuery ($) ->
$('.smiley-select select').change () ->
$(this).closest('form').submit();
$('.smiley-toggle').on 'click', (event) ->
element = $(this)
element.attr 'disabled': true
element.addClass 'ajax'
$.getJSON(
element.attr 'href'
@tleilax
tleilax / dabblet.css
Created February 3, 2012 15:37
Untitled
th {
vertical-align: bottom;
}
th.vertical, td.vertical {
display: inline-block;
text-align: center;
width: 1em; /* px tuts auch nicht*/
}
th.vertical {
@tleilax
tleilax / dabblet.css
Created February 3, 2012 16:00
Stud.IP - DirectionButtons test
/**
* Stud.IP - DirectionButtons test
**/
.button.left:before, .button.right:after {
content: " ";
width: 16px;
height: 16px;
}
@tleilax
tleilax / Controller.class.php
Created February 9, 2012 10:22
My current, but almost deprecated approach to MVC in PHP (not guaranteed to work like this, misses files)
<?php
abstract class Controller implements ArrayAccess
{
static protected $messages = array(
'error' => array(),
'notice' => array(),
'success' => array()
);
protected $template = null,
$data = array(),
@tleilax
tleilax / dispatch.php
Created February 28, 2012 07:47
Simple dispatcher
function dispatcher($controller = null, $method = null)
{
$controller = $controller ?: $_REQUEST['controller'];
$method = $method ?: $_REQUEST['method'] ?: 'index';
$class = $controller . 'Controller';
$action = $method . '_action';
if (!class_exists($class)) {
require 'controllers/' . $class . '.php';
{
"activities":[
{
"id":"fe54b86db98f7dbe73d5520de44c2f26",
"title":"Datei: Activity Feed",
"author_id":"c2fd13b5fc964d2a75afcf269c1bac17",
"link":"\/trunk\/folder.php?cid=834499e2b8a2cd71637890e5de31cba3&amp;cmd=tree&amp;open=fe54b86db98f7dbe73d5520de44c2f26#anker",
"updated":"1332577862",
"summary":"O Auth hat im Dateibereich der Veranstaltung \"Test Lehrveranstaltung\" die Datei \"Acitivy Feed\" hochgeladen.",
"content":"Plugin",