Apr
21
2009
2

Project “die-bauberater24.de” finished!

Die Bauberater 24

Not only the logo has been redesigned, but the website went online at www.die-bauberater24.de, too!

Mrz
04
2009
2

MAMP and Ruby Mysql gem?

Yes, it's possible - I tried many ways that didn't work, but finally found a great solution:

http://boonedocks.net/mike/archives/175-MAMP-and-the-Ruby-MySQL-Gem.html

Thanx!

Written by Patrick Weinstein in: Allgemein, Mac, Mysql, Ruby |
Feb
01
2009
2

patworx.de in neuem Outfit!

Fast pünktlich zum Jahreswechsel (nagut, ein Monat ist schon vergangen ;-) ) erstrahlt patworx.de in einem neuen Outfit, und auch unser Blog wurde neu eingekleidet. Eventuell baue ich auch mal ein Theme für unseren Blog, das in das patworx.de-Design eingebunden ist...

Written by Patrick Weinstein in: Allgemein |
Jan
31
2009
2

Google hält sich selbst für gefährlich

Da hab ich nicht schlecht gestaunt, als heute Nachmittag sämtliche Google-Ergebnisse als "gefährlich" eingestuft wurden. Schuld daran war eine kleine Panne bei Google selbst. Eine Stellungnahme dazu gibt's hier:

http://googleblog.blogspot.com/2009/01/this-site-may-harm-your-computer-on.html

Da kann man nur hoffen dass Google mit den Daten seiner User (ganz gleich ob Mail-Accounts, GoogleDocs oder ganz andere Geschichten) ein wenig vorsichtiger umgeht, als mit diesem Update...

Written by Patrick Weinstein in: Allgemein |
Jan
29
2009
2

Transparente PNG Grafik auch mit Internet Explorer 6!

Der ein oder andere wird es sicherlich kennen - das Problem, dass auch 2009 noch viel zu viele Leute mit IE6 unterwegs sind und dieser ja bekanntlich Probleme mit der Transparenz von PNG-Grafiken hat.

Das ganze kann allerdings mit Hilfe eines kleinen aber feinen Scriptes umgangen werden, so dass man volle Transparenz auch im IE6 vorfindet.

Das gute Stück, das nur mit einer einzigen CSS-Zeile eingebunden werden muss, gibt's hier:
http://www.twinhelix.com/css/iepngfix/

Noch schöner aber wäre natürlich, wenn der IE einfach nicht mehr im Einsatz wäre ;-)

Written by Patrick Weinstein in: CSS |
Okt
06
2008
2

http://anne-chrissi-roundtheworld.kaletsch-forchheim.de/

Der Blog von meiner Schwester für ihre Weltreise ist jetzt online!

http://anne-chrissi-roundtheworld.kaletsch-forchheim.de/

Ich freue mich schon: Vom 20.12-10.1 werde ich ihr einen Besuch in Australien abstatten :)

Dann gibt's neen Roadtrip von Melbourne nach Sydney!

Jun
30
2008
2

ErrorHandle

Hi,

hier ein kleines Tool um Fehler in PHP abzufangen und zu handeln:

 
<?php
require_once 'ErrorHandle.class.php';
error_reporting(E_ALL);
ini_set("error_display",0);
set_error_handler(array("ErrorHandle", "add"));
?>
 
 
<?php
class ErrorHandle{
	private static $errors = array();
	public static $send = false;
 
	public static $errortypes_to_ignore = array(E_STRICT);
 
	public static function add($errno, $errmsg, $filename, $linenum){
		ErrorHandle::$errors[] = new ErrorHandle($errno, $errmsg, $filename, $linenum);
	}
 
	public static function getAll(){
		return ErrorHandle::$errors;
	}
 
	public static function toString(){
		$return = "";
		foreach(ErrorHandle::getAll() as $error){
			$msg = $error->__toString();
			if($msg != false){
				$return .= $msg . "\n\n";
			}
		}
		return $return;
	}
 
	private $errno = "";
	private $errmsg = "";
	private $filename = "";
	private $linenum = "";
	private $trace = array();
 
	public $errortypes = Array(
		E_ERROR    => 'Error',
		E_WARNING   => 'Warning',
		E_PARSE    => 'Parsing Error',
		E_NOTICE   => 'Notice',
		E_CORE_ERROR  => 'Core Error',
		E_CORE_WARNING  => 'Core Warning',
		E_COMPILE_ERROR  => 'Compile Error',
		E_COMPILE_WARNING => 'Compile Warning',
		E_USER_ERROR  => 'User Error',
		E_USER_WARNING  => 'User Warning',
		E_USER_NOTICE  => 'User Notice',
		E_STRICT   => 'Runtime Notice'//,
		//E_RECOVERABLE_ERRROR=> 'Catchable Fatal Error'
	);
 
	public function __construct($errno, $errmsg, $filename, $linenum){
		$this->errno = $errno;
		$this->errmsg = $errmsg;
		$this->filename = $filename;
		$this->linenum = $linenum;
		$this->trace = debug_backtrace();
	}
 
	public function __destruct(){
		if(ErrorHandle::$send == true) return false;
		ErrorHandle::$send = true;
 
		echo ErrorHandle::toString();
	}
 
	public function __toString(){
		if(	in_array($this->errno, ErrorHandle::$errortypes_to_ignore)	) return false;
 
		ob_start();
		print_r($this->trace);
		$trace_ret = ob_get_contents();
		ob_end_clean();
 
		return 	"Errortype:\t" 	. $this->errortypes[$this->errno] . "\n" .
				"Filename:\t"	. $this->filename  . "\n" .
				"Linenumber\t"	. $this->linenum . "\n" .
				"Errormsg\t"	. $this->errmsg . "\n" .
				"\nTrace: \n" 	. $trace_ret;
	}
}
?>
 

Kleiner Tipp: Leichte Erweiterung und Einbettung in HTML möglich :)

Written by Alexander Kaletsch in: Allgemein |
Jun
25
2008
2

Simple Apache Frameforward

Hier ein kleiner und simpler Frameforwarder von Pat und mir:

Apache Config:

 
<VirtualHost *>
        ServerName blog.alexander-kaletsch.de
        DocumentRoot /yourpath/forwarder
 
        ErrorLog /yourpath2/forwarder.error.log
 
        LogLevel warn
 
        CustomLog /yourpath3/forwarder.log combined
        ServerSignature On
</VirtualHost>
 

Weitere Subdomains können dann einfach über ServerAlias hinzugefügt werden.

Die index.php die sich im Forwarder Verzeichnis befinden muss:

 
<?php
error_reporting(0);
ini_set("error_display",0);
 
$mapper = array("blog.alexander-kaletsch.de" => "http://www.patworx.de/blog");
 
$host = $_SERVER['HTTP_HOST'];
$url = $mapper[$host];
 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$host?></title>
<style type="text/css">
<!--
HTML, BODY, FRAMESET, FRAME, NOFRAMES{
	height: 100%; 
	width: 100%
}
-->
</style>
 
</head>
<frameset>
    <frame frameborder="0" name="main" title="<?=$host?>" noresize="noresize" src="<?=$url?>"/>
    <noframes>
    <body>
 
<a href="<?=$url?>">Klicken Sie hier, da Ihr Browser keine Frames unterstu&uuml;zt</a>
 
    </body>
    </noframes>
</frameset>
</html>
 
Written by Alexander Kaletsch in: Allgemein, PHP, Snippets | Schlagwörter:,
Jun
25
2008
3

iCal

Die Klasse habe ich zwar schon vor einigen Monaten geschrieben, aber Dorian (http://www.proksch-it.de/) hat mich dazu bewogen, sie doch noch zu veröffentlichen, da er sie nun selbst verwendet.

Eine minimalistische Klasse für die Generierung von iCal Files.

Ziel ist: Wenig Features und wenig Probleme :)

 
class iCal{
	private $valid_elems = array("author", "start", "end", "topic", "msg", "location");
	private $min_elems = array("author", "start", "end",  "topic", "msg");
 
	public function __construct($values = array()){
		foreach($values as $key => $value){
			$this->set($key, $value);
		}
	}
 
	public function __set($key, $value){
		if(!in_array($key, $this->valid_elems)) throw new Exception("Element nicht zugelassen");
 
		$this->$key = $value;
	}
 
	public function __get($key){
		if(!in_array($key, $this->valid_elems)) throw new Exception("Element nicht vorhanden");
		return isset($this->$key) ? $this->$key : null;
	}
 
	public function __toString(){
		foreach($this->min_elems as $value){
			if($this->$value === null) throw new Exception("Nicht alle Pflichtelemente angegeben");
		}
 
		if(headers_sent()) throw new Exception("Header wurden bereits gesendet!");
 
		header('Content-Type: text/Calendar; charset=UTF-8');
		header('Content-Disposition: attachment; filename=iCal_' . date('Y-m-d_H-m-s') . '.ics');
 
		$output = "";
		$output  = (string) "BEGIN:VCALENDAR\r\n";
		$output .= 'PRODID:' . '#//PHP/AKCD//DE' . "\r\n";
		$output .= "VERSION:2.0\r\n";
		$output .= "METHOD:PUBLISH\r\n";
		$output .= "BEGIN:VEVENT\r\n";
		$output .= "DTSTART:". gmdate('Ymd\THi00\Z', $this->start) ."\r\n";
		$output .= "DTEND:". gmdate('Ymd\THi00\Z', $this->end) ."\r\n";
		if($this->location !== null) $output .= "LOCATION" . $this->quotedPrintableEncode($this->location) ."\r\n";
		$output .= "TRANSP:OPAQUE\r\n";
		$output .= "SEQUENCE:0\r\n";
		$output .= "UID:". md5("ICAL".$this->start.rand(1,5000).$this->end)."\r\n";
		$output .= "DTSTAMP:".gmdate('Ymd\THi00\Z',time())."\r\n";
		$output .= "CATEGORIES".$this->quotedPrintableEncode($this->author)."\r\n";
		$output .= "DESCRIPTION".$this->quotedPrintableEncode($this->msg)."\r\n";
		$output .= "SUMMARY".$this->quotedPrintableEncode($this->topic)."\r\n";
		$output .= "PRIORITY:5\r\n";
		$output .= "CLASS:PUBLIC\r\n";
		$output .= "STATUS:CONFIRMED\r\n";
		$output .= "END:VEVENT\r\n";
		$output .= "END:VCALENDAR\r\n";
 
		return $output;
	}
 
	private function quotedPrintableEncode($msg, $lang = "de"){
		$msg = preg_replace('/<a href="(.*)">.*<\/a>/i', "$1", $msg);
		$msg = str_replace("€", "Euro", $msg);
		$msg = ereg_replace("(\r\n|\n|\r)", "=0D=0A", $msg);
		return ";LANGUAGE=de;ENCODING=QUOTED-PRINTABLE:" . $msg;
	}
}
 

Sample:

 
$iCal = new iCal(); 
 
$iCal->start	= time() + (24 * 60 * 60);
$iCal->end	= time() + (24 * 60 * 60 * 3);
$iCal->author	= "Alexander-Kaletsch.de";
$iCal->msg	= utf8_encode('Hallo <img src='http://www.patworx.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ');
$iCal->location	= utf8_encode('http://www.alexander-kaletsch.de');
$iCal->topic	= utf8_encode('Visit Alexander-Kaletsch.de');
 
echo $iCal;
 

Wer unbedingt mehr Features benötigt sollte sich die iCal Klassen von Michael Wimmer (http://www.flamino.com) anschauen.

Written by Alexander Kaletsch in: PHP, Snippets | Schlagwörter:
Jun
24
2008
2

Projekt www.descargasimaginarium.es fertig gestellt!

Imaginarium

Unter der URL www.descargasimaginarium.es wurde das spanische Download-Portal der Spielwarenfirma Imaginarium gestartet.

Written by Patrick Weinstein in: Projekte |

Powered by WordPress | Theme: Aeros 2.0 by TheBuckmaker.com