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 / input.scss
Created September 26, 2022 13:35
Generated by SassMeister.com.
@function con($color, $light, $dark, $threshold: 51) {
@return if(lightness($color) < $threshold, $light, $dark);
}
a {
color: con(#fff, #abc, #cde);
}
@tleilax
tleilax / AutoComplete.vue
Last active April 8, 2021 12:46
Stud.IP: AutoComplete component for vue.js
<!--
Autocomplete component with keyboard selection
Usage:
<autocomplete :results="results"
@select="selectedAnswer">
</autocomplete>
Slots are optional but if you want to adjust the result display you should
@tleilax
tleilax / Pagination.vue
Created November 19, 2020 10:24
Stud.IP: Pagination component for vue.js
<template>
<div>
<p :id="`pagination-label-${id}`" class="audible">
Blättern
</p>
<ul class="pagination" role="navigation" :aria-labelledby="`pagination-label-${id}`">
<li v-if="currentPage > 0" class="prev">
<a href="#" @click.prevent="selectPage(currentPage - 1)">
<span class="audible">Eine Seite</span>
zurück
@tleilax
tleilax / .editorconfig
Last active January 30, 2020 08:05
Stud.IP: EditorConfig
# EditorConfig is awesome: http://EditorConfig.org
# Top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
@tleilax
tleilax / lightpack2.gist
Created November 20, 2019 12:09 — forked from mlava/lightpack2.gist
Lightpack 2 Bluetooth Low Energy (BLE) characteristics
https://www.kickstarter.com/projects/woodenshark/lightpack-2-ultimate-light-orchestra-for-your-livi/
All characteristics:
handle: 0x0002, char properties: 0x02, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0007, char properties: 0x20, char value handle: 0x0008, uuid: 00002a05-0000-1000-8000-00805f9b34fb
handle: 0x000b, char properties: 0x1a, char value handle: 0x000c, uuid: f5d0bf71-9670-4b25-97f1-861f5ebf0500
handle: 0x000f, char properties: 0x1a, char value handle: 0x0010, uuid: f5d0bf71-9670-4b25-97f1-861f5ebf0400
handle: 0x0013, char properties: 0x12, char value handle: 0x0014, uuid: f5d0bf71-9670-4b25-97f1-861f5ebf0300
<?php
trait PluginAssetsTrait
{
protected function getPluginVersion()
{
static $manifest = null;
if ($manifest === null) {
$manifest = $this->getMetadata();
}
return $manifest['version'];
@tleilax
tleilax / debug-studip-pdo.diff
Last active March 8, 2019 13:03
Stud.IP query log in default installation without plugins (Caching disabled)
Index: lib/classes/DBManager.class.php
===================================================================
--- lib/classes/DBManager.class.php (revision 51469)
+++ lib/classes/DBManager.class.php (working copy)
@@ -171,6 +171,9 @@
// PDO connection should throw exceptions and use buffered queries
private function configureConnection($connection)
{
+ if (!Request::isXhr()) {
+ $connection->debug_mode = true;
Index: lib/classes/admission/AdmissionPriority.class.php
===================================================================
--- lib/classes/admission/AdmissionPriority.class.php (revision 51112)
+++ lib/classes/admission/AdmissionPriority.class.php (working copy)
@@ -1,5 +1,4 @@
<?php
-
/**
* AdmissionPriority.class.php
*
Index: resources/assets/javascripts/bootstrap/tooltip.js
===================================================================
--- resources/assets/javascripts/bootstrap/tooltip.js (revision 50796)
+++ resources/assets/javascripts/bootstrap/tooltip.js (working copy)
@@ -1,3 +1,5 @@
+/*jslint esversion: 6*/
+
// Attach global hover handler for tooltips.
// Applies to all elements having a "data-tooltip" attribute.
// Tooltip may be provided in the data-attribute itself or by
Index: tests/unit/lib/CalendarcolumnClassTest.php
===================================================================
--- tests/unit/lib/CalendarcolumnClassTest.php (revision 50714)
+++ tests/unit/lib/CalendarcolumnClassTest.php (working copy)
@@ -83,7 +83,7 @@
}
function test_wrong_entry() {
- $this->setExpectedException('InvalidArgumentException');
+ $this->expectException('InvalidArgumentException');