Skip to content

Instantly share code, notes, and snippets.

View Flyingmana's full-sized avatar
📄
Fighting against bureaucracy

Daniel Fahlke Flyingmana

📄
Fighting against bureaucracy
View GitHub Profile
@Flyingmana
Flyingmana / description
Created March 25, 2012 22:25
configure owncloud under yaws - webserver
yaws_404_to_index_php.erl is the src for a custom 404 errormod.
This error mod executes the request with index.php in docroot, if the requests file does not exist in filesystem.
This code only works with php configured as cgi, but sure could easy extended to support fcgi, too.
You compile this with 'erlc' and have to place it in the ebin directory of yaws.
For more information look at http://yaws.hyber.org/ and https://github.com/klacke/yaws
In the config the "dir_listings = false" is important and also the redirect from "/data" to somewhere else, because files will be saved in this directory and it should not be accessable from the outside.
@Flyingmana
Flyingmana / simple_exporter.php
Created April 23, 2011 00:33
ezmlm exporter
<?php
require_once 'ezc/Base/base.php';
spl_autoload_register( array( 'ezcBase', 'autoload' ) );
function fetch( $messageNrs , $imap){
$mails = array();
foreach( $messageNrs as $nr)
{
@Flyingmana
Flyingmana / definition.json
Created February 24, 2011 12:21
example definition file for pere
{
"author": "flyingmana",
"repositories" : [
{
"source" : "svn://arbitracker.org/phpillow/trunk",
"fetcher" : "svn",
"target" : "phpillow",
"autoload" :
{
"scan" : ["src/classes/"]
<?php
return function($site,$nick,$user,$addr,$wildsite,$chan,$text) {
global $Database;
echo "$chan->$nick: $text\n";
$text = strtolower($text);
$tok = explode(" ",$text);
$db = "{$this->Irc['Nick']}_{$this->Irc['Channel']}";
mysql_select_db($db);
$result = mysql_query("SELECT * FROM users");
@Flyingmana
Flyingmana / OnText.php
Created November 3, 2010 20:15
a relodable OnText event
<?php
return function($text){
if($text == "hello"){
//do hello world
}
if($text == "kill me"){
//took a gun and shoot =P
}
}