Posts Tagged with "tricks"

Redis: How to delete keys matching a pattern

Posted by Stanislav Furman on April 10, 2014

Sometimes you might want to purge a set of similar Redis keys in one shot. So far, standard Redis "DEL" command does not allow to remove keys using patterns. However, there is a trick to do this action. Execute the following command in bash:


redis-cli -h [host] -p [port] KEYS "prefix:*" | xargs redis-cli DEL

Seems clear? Wait a minute! What if you use multiple databases (keyspaces) and need to remove keys from a database different from default (0) one? No problem there! Here is the solution:

Continue reading

File search and wildcards in PHP

Posted by Stanislav Furman on June 7, 2013
How to search files in PHP using wildcards and patterns

How to trim array elements in PHP in one shot

Posted by Stanislav Furman on April 18, 2013
Remove all leading and trailing white spaces in all PHP array values.

How to get most accurate visitor's IP address in PHP

Posted by Stanislav Furman on April 15, 2013
Learn how to get most accurate user's IP address in PHP.

Reading file list from a mapped Windows network drive

Posted by Stanislav Furman on March 25, 2013
How to read a file list from mapped Windows network drives

CSS rounded corners

Posted by Stanislav Furman on February 26, 2012
How to create CSS rounded corners

How to secure your php application

Posted by Stanislav Furman on February 21, 2012
10 useful tips to make your php application safe. Good practices in creating a secured web application

CSS Centering Trick: How to center a div or an image?

Posted by Stanislav Furman on February 15, 2012
How to center an item in HTML using CSS.

12 SEO tips that everyone should know

Posted by Stanislav Furman on February 10, 2012
Learn about most powerful and useful SEO practices.