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 / 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
}
}
<?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 / 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/"]
@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 / 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.
<?php
/**
a little simulation for my brother who thought,
you can make money with the right roulette strategy.
**/
$budget = 1000000;
$games = 0;
@Flyingmana
Flyingmana / dabblet.css
Created June 11, 2012 11:51 — forked from anonymous/dabblet.css
format dd and dt as group
/**
* format dd and dt as group
*/
hmtl{
background: #f06;
background: white;
min-height: 100%;
}
.block{
float:left;
@Flyingmana
Flyingmana / config.xml
Last active December 23, 2015 04:39
improve magento performance by deactivate db logging and a few page parts
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Cotya_Performance>
<version>0.1.0</version>
</Cotya_Performance>
</modules>
<frontend>
<?php
error_reporting(-1);
function magento_removeTags($html){
$html = @preg_replace("# <(?![/a-z]) | (?<=\s)>(?![a-z]) #exi", "htmlentities('$0')", $html);
$html = strip_tags($html);
return htmlspecialchars_decode($html);
}
function magento_removeTags_fixed($html){
@Flyingmana
Flyingmana / _magento_composer_taf_result.out
Last active August 29, 2015 13:56
Magneto Composer TAF result
PHPUnit 3.6.10 by Sebastian Bergmann.
Configuration read from /work/magento/wf_magento_example/taf/phpunit.xml.dist
.................................FF........F.............EE.F 61 / 1570 ( 3%)
FFFEFSSSSSSSSSSSFSSSSSSSSSSSSSSFSSSSSSSSSSSSSSSFSSSSSSSSSSSSS 122 / 1570 ( 7%)
SSSSSSSSSSSSSSSSSFSSSSSSSSSSSFSSSSSSSSSSSSSSFSSSSSSSSSSSSSSSF 183 / 1570 ( 11%)
SSSSSSSSSSSSSSSSSSSSFSSSSSSSSSSSFSSSSSSSSSSSSSSFSSSSSSSSSSSSS 244 / 1570 ( 15%)
SSFSSSSSSSSSSSFSSSSSSSFSSFSSSSSSSSSSSFSSSSSSSFSSFSSSSSSSSSSSS 305 / 1570 ( 19%)
SSSSSSSSSFSSSSSSSSSSSFSSSSSSSFSSFFSSSSSSSSSSSSSSSSSSSSSSSSSSS 366 / 1570 ( 23%)