Skip to content

Instantly share code, notes, and snippets.

// 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");
#!/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
#!/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
@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 {
@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 / 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,
<?php
class Foo
{
// ...
/**
* Setzt den Helpbar-Inhalt für die Funktionen des Plugins
*/
protected function getHelpbarContent($key)
{
result = []
(1..3).each {|w1|
(1..3).each {|w2|
(1..3).each {|w3|
(1..3).each {|w4|
(1..3).each {|w5|
result << w1 + w2 + w3 + w4 + w5
}}}}}
require "pp"
test css
<?php
require 'authenticated_controller.php';
class SheriffController extends AuthenticatedController
{
function index_action()
{
$args = func_get_args();