Skip to content

Instantly share code, notes, and snippets.

@LukasReschke
LukasReschke / pagecontroller.php
Created June 26, 2014 19:03
pagecontroller.php
<?php
/**
* ownCloud - passman
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Sander Brand <brantje@gmail.com>
* @copyright Sander Brand 2014
*/

Keybase proof

I hereby claim:

  • I am lukasreschke on github.
  • I am lukasreschke (https://keybase.io/lukasreschke) on keybase.
  • I have a public key whose fingerprint is 4E16 FFDA 9CCF 3FF9 EFBF 8E0A 9F57 5ED9 23EB F2BD

To claim this, I am signing this object:

<?php
// The libxml entity loader is disabled by default
// even setting the libxml_disable_entity_loader to false doesn't works!
//
// @see http://uk3.php.net/manual/en/function.libxml-disable-entity-loader.php
// @see http://stackoverflow.com/a/10213239
$dir = __DIR__;
$content = 'This is a remote content!';
file_put_contents('content.txt', $content);
@LukasReschke
LukasReschke / appinfo\VERSION
Created June 23, 2013 15:17
Load a JS file in ownCloud for not logged-in users
1.0
@LukasReschke
LukasReschke / mp3_convert.sh
Created August 31, 2012 14:06
Converts all mp3 files in a directory to 128kbit/s if necessary
#!/bin/bash
# Requirements: ffmpeg, mp3info
# Do a "mkdir output" before execution
for f in *.mp3; do
if [ "$(mp3info -r m -p %r "$f")" -ge 128 ]; then
ffmpeg -y -i "$f" -ab 128k "output/${f%.mp3}.mp3"
else
cp "$f" "output/$f"
fi; done
@LukasReschke
LukasReschke / fizzbuzz.go
Created August 5, 2012 17:42
FizzBuzz in Golang
package main
import "fmt"
func main() {
for i := 1; i < 101; i++ {
switch {
case i%15 == 0:
fmt.Println("FizzBuzz")
case i%3 == 0: