Skip to content

Instantly share code, notes, and snippets.

https = require 'https'
Q = require 'q'
fs = require "fs"
url_lib = require 'url'
# configuration
user = 'studip-plugins'
target_dir = '/tmp'
@luniki
luniki / simplexml.php
Created June 7, 2012 09:03
simplexml example
<?
$xml = '<?xml version="1.0" encoding="UTF-8"?><dublincore xmlns="http://www.opencastproject.org/xsd/1.0/dublincore/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/"><dcterms:format xsi:type="dcterms:IMT">video/x-dv</dcterms:format><dcterms:publisher>Stud.IP 2.4 (bender.virtuos.uos.de)</dcterms:publisher><dcterms:identifier>804ad1e40cedc06fd8ce8986385f8491</dcterms:identifier><dcterms:title xml:lang="en">Opencast-Test</dcterms:title></dublincore>';
$s = new SimpleXMLElement($xml);
var_dump($s->xpath('//dcterms:format'));
var_dump($s->xpath('//dcterms:publisher'));
var_dump($s->xpath('//dcterms:identifier'));
var_dump($s->xpath('//dcterms:title'));
@luniki
luniki / avatars.php
Created March 20, 2012 08:42
Stud.IP avatar controller
<?
class AvatarsController extends Trails_Controller
{
/**
* custom before filter
*/
function before()
{
# require a logged in User or else redirect to session/new
@luniki
luniki / README.markdown
Created February 24, 2012 09:46
OAuthAPIProvider

Stud.IP Restful APIs mit OAuth

Ziel ist es, ein Plugin (oder Kernfunktionalität) anzubieten, dass Restful Webservices, die mit OAuth abgesichert sind, für 3rd-party-tools zugänglich macht.

Die APIs sollen (auch) als Plugins zuschaltbar sein. Dazu wird zunächst ein Verwaltungsplugin "OAuthAPIProvider" geschaffen, dass einen neuen Plugintyp einführt, den API-liefernde Plugin implementieren müssen.

### Stud.IP Restful APIs mit OAuth ###
Ziel ist es, ein Plugin (oder Kernfunktionalität) anzubieten, dass
Restful Webservices, die mit OAuth abgesichert sind, für
3rd-party-tools zugänglich macht.
Die APIs sollen (auch) als Plugins zuschaltbar sein. Dazu wird
zunächst ein Verwaltungsplugin "OAuthAPIProvider" geschaffen, dass
einen neuen Plugintyp einführt, den API-liefernde Plugin
implementieren müssen.
@luniki
luniki / 0-assets.yml
Created February 21, 2012 12:57
PHP vs yaml
compress: true
javascripts:
jquery: &jquery
- javascripts/jquery-1.7.js
- javascripts/jquery-ui-1.8.14.custom.min.js
- javascripts/jquery.metadata.js
- javascripts/jquery.placehold-0.3.js
- javascripts/validator.min.js
base:
@luniki
luniki / dispatcher.php
Created February 10, 2012 10:05
Trails ohne filesystem
<?
class MyDispatcher extends Trails_Dispatcher {
public $routes = array();
function parse($path) {
foreach ($this->routes as $route) {
if ($route->matches($path)) {
@luniki
luniki / 00-Interactable.php
Created January 3, 2012 10:46 — forked from aklassen/00-Interactable.php
Button-StEP RC1
<?php
/*
* Copyright (c) 2011 mlunzena@uos.de, aklassen@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.
*/
@luniki
luniki / bugprediction.org
Created December 16, 2011 13:43
Stud.IP BIEST Prediction
@luniki
luniki / 00-Interactable.php
Created December 8, 2011 13:26
Button-StEP RC1
<?php
/*
* 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.
*/