Skip to content

Instantly share code, notes, and snippets.

@luniki
luniki / timestamp.sql
Created February 28, 2018 10:30
CliqrPlugin timestamp Migration
ALTER TABLE etask_tasks ADD `mkdate` INT(11) NOT NULL AFTER `created`, ADD `chdate` INT(11) NOT NULL AFTER `changed`;
UPDATE etask_tasks SET mkdate = UNIX_TIMESTAMP(created), chdate = UNIX_TIMESTAMP(changed);
ALTER TABLE etask_tasks DROP `created`, DROP `changed`;
ALTER TABLE etask_tests ADD `mkdate` INT(11) NOT NULL AFTER `created`, ADD `chdate` INT(11) NOT NULL AFTER `changed`;
UPDATE etask_tests SET mkdate = UNIX_TIMESTAMP(created), chdate = UNIX_TIMESTAMP(changed);
ALTER TABLE etask_tests DROP `created`, DROP `changed`;
ALTER TABLE etask_responses ADD `mkdate` INT(11) NOT NULL AFTER `created`, ADD `chdate` INT(11) NOT NULL AFTER `changed`;
UPDATE etask_responses SET mkdate = UNIX_TIMESTAMP(created), chdate = UNIX_TIMESTAMP(changed);
@luniki
luniki / showDialog.js
Created September 26, 2016 08:14
STUDIP.Dialog und Backbone.View
import Backbone from 'backbone'
import _ from 'underscore'
import Promise from 'bluebird'
const showDialog = function (backboneView, dialogOptions) {
return new Promise(function (resolve, reject) {
const hygenicDialogClass = _.uniqueId('cliqr--dialog-')
@luniki
luniki / showDialog.js
Created September 26, 2016 08:13
STUDIP.Dialog und Backbone.View
import Backbone from 'backbone'
import _ from 'underscore'
import Promise from 'bluebird'
const showDialog = function (backboneView, dialogOptions) {
return new Promise(function (resolve, reject) {
const hygenicDialogClass = _.uniqueId('cliqr--dialog-')
<?php
class Foo
{
// ...
/**
* Setzt den Helpbar-Inhalt für die Funktionen des Plugins
*/
protected function getHelpbarContent($key)
{
@luniki
luniki / personal-notifications.diff
Created November 4, 2014 12:05
Schnelles Als-gelesen-markieren von Personal Notifications
diff --git a/public/assets/javascripts/personal_notifications.js b/public/assets/javascripts/personal_notifications.js
index 09a9777..d709cdb 100644
--- a/public/assets/javascripts/personal_notifications.js
+++ b/public/assets/javascripts/personal_notifications.js
@@ -63,17 +63,13 @@
return false;
},
sendReadInfo: function (id, notification) {
- $.ajax({
- 'url': STUDIP.ABSOLUTE_URI_STUDIP + "dispatch.php/jsupdater/mark_notification_read/" + id,
@luniki
luniki / keybase.md
Last active August 29, 2015 14:06 — forked from anonymous/keybase.md

Keybase proof

I hereby claim:

  • I am luniki on github.
  • I am luniki (https://keybase.io/luniki) on keybase.
  • I have a public key whose fingerprint is 69C1 B4CE 80F4 7C25 CA45 4F52 732F 467A D6EB 638B

To claim this, I am signing this object:

@luniki
luniki / pluginengine.php
Created July 8, 2014 08:22
PluginEngine v2.0++
<?
interface SomeRole {
public function foo();
public static function bar();
}
class A extends Plugin {}
class B extends A {
#!/bin/bash
sudo apt-get install python-software-properties libpq-dev
# System level dependencies for Graphite
sudo apt-get install memcached python-dev python-pip
sudo apt-get install postgresql postgresql-client
sudo apt-get install libcairo2 libcairo2-dev python-cairo python-psycopg2
sudo apt-get install pkg-config build-essential
#!/bin/bash
# node.js using PPA (for statsd)
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
# Install git to get statsd
sudo apt-get install git
// copies the HTTP request body from php://input
private static $request_body_stream;
// reads the HTTP request body
// TODO: the body may be too large !!!
private function parseRequestBody($mediaType)
{
if (!isset(self::$request_body_stream)) {
$src = fopen("php://input", "rb");