PHP: phpMyAdmin3 - deactivate slider effects

For all of you who liked phpMyAdmin2 where all relevant information was visible at any time, sould be annoyed be the new slider effects in phpMyAdmin3.
I did a short search for the config value to change this and found this solution.

Add this to your config.inc.php:

// Change slider behaviour
$cfg['InitialSlidersState'] = 'open';

And your sliders will start in visible state.

phpMyAdmin download:
http://www.phpmyadmin.net/home_page/downloads.php

PHP: floor() and ceil() are slow!

A workmate mentioned, that floor($i) could be replaced with (int)$i.
I found this very interresting and did some researched about that.

floor($i); will return a float that will have the lower value of $i.
A cast will just convert $i to an integer which will cut of all decimals.
So by symptoms, these two methods are equivalent. Even if floor returns a float, PHP does dynamic casting of its variables.


|Den ganzen Beitrag lesen...

PHP: Do NOT rebuild preg_* functions!

In a PHP Project i am currently helping out, i found this function:

/**
 * Replaces every char in $str that does is not in $valid array
 *
 * @param array $valid
 * @param string $str
 * @return string
 */

function cleanString($valid, $str) {
  $ret = '';
  $len = strlen($str);
  for($i = 0; $i < $len; ++$i) {
    if(in_array($str[$i], $valid, true)) {
      $ret .= $str[$i];
    }
  }
  return $ret;
}

It is a simple function for replacing chars. It works quite well, but was mainly only used for checking [^a-z0-9]. So i tested the speed of this code.

|Den ganzen Beitrag lesen...

My mirror for Geany and Lighttpd

I decided to create a simple mirror for software i recently use.
Currently you can find download.geany.org and www.lighttpd.net/download/.

Url is:
http://juliusbeckmann.de/mirror/

Just in case the project sites get down or older files get deleted there.

Hopy you enjoy it.

PHP: Easy Memcache handling

In a current project of mine i needed the use of a universal caching system.
After testing a little bit with APC i found memcache that will do the job perfectly.
So i wrote a few tiny functions for easy memcache handling.

|Den ganzen Beitrag lesen...

Verkaufe Domains: geekvz.(net|com|de)

Ich biete 6 Domains im Paket an. Es sind folgende Domains beinhaltet:

  • geekvz.de
  • geekvz.net
  • geekvz.com
  • geek-vz.de
  • geek-vz.net
  • geek-vz.com

Ideal um sein eigenes Verzeichnis wie z.B. StudiVZ oder Facebook aufzubauen.
Paketpreis ist 200 Euro.
Anfragen bitte per Email.

English:
I sell the mentioned domain names for a package price of 200 Euro. Contact please via Email.

Rewrite: PHP String Flipper Class

I found this class on Twitter. Nice idea flipping chars by replacing them with their unicode upside down alternative.
But what bugged me was the code, it looked awful. So id did a rewrite to clean it up a little bit.

|Den ganzen Beitrag lesen...

HowTo: Use the ternary operator in PHP

A good program is sometimes equalized with few lines of code. But how do we program this way? One step is using the ternary operator...

|Den ganzen Beitrag lesen...

Correct Hashing Passwords in PHP

I found this article about password hashing in PHP on Twitter and found a few serious points that are not fully correct in this article.

|Den ganzen Beitrag lesen...

Easy to use and secure PHP hashing Class

Why

I created this class because there are too many people still saving simple md5 instead of more secure hashes.
The class should be fully PHP4 and PHP5 compatible and very easy to use. But also extended usage on its complex methods is possible.

Example

The usage of the class should be straight forward.
If you just want to use it, use the methods hash() and check().
EXAMPLE:

$secure_hash = new secure_hash;
$hash = $secure_hash->hash('pass');
if($secure_hash->check($hash, 'pass'))
  echo "Password fits to hash.";
else
  echo "Password does NOT fit to hash.";

That is all you need to know for just using it, but i have to tell, you will miss something important if you stop reading here.

|Den ganzen Beitrag lesen...


#