Archive for April, 2011

How to trim recursively in PHP

April 28th, 2011 by usage | 0

How to recursively trim in PHP <?php // Usage: echo Our_Util_String::trim(‘test’); /** * Util string functions. * * @author Svetoslav Marinov <svetoslavm@gmail.com> * @copyright Svetoslav Marinov <svetoslavm@gmail.com> & others * @version 1.0 */ class Our_Util_String { /** * Recursive Trimmer :) * http://php.net/manual/en/function.trim.php * * @param mixed $arr * @param string $charlist * @return mixed […]






jquery

April 27th, 2011 by usage | 0

How to set focus on first visible input box <script type=”text/javascript”> jQuery(document).ready(function($) { $(“input:text:visible:first”).focus(); }) </script> If you have embed code the code below selects the text when the user clicks on the textarea. Also the text area is readonly so the user can’t accidentally delete or cut fewer characters. <script type=”text/javascript”> jQuery(document).ready(function($) { $(“.embed_code”).click(function() […]






Zend Framework: Logout User

April 27th, 2011 by usage | 0

This snippet shows how to login i.e. clear the session of the logged user.











Redirect in Zend Framework

April 27th, 2011 by usage | 0

an example how to make a redirect in Zend Framework











convert

April 24th, 2011 by usage | 0

convert – convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.











xcopy

April 24th, 2011 by usage | 0

How to copy all doc files xcopy /s /c /y “c:Documents and SettingsMYUSER*.doc” d:BackupsMyLaptopAll_Docs Copies files and directory trees. XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B] [/EXCLUDE:file1[+file2][+file3]…] source Specifies the file(s) to […]






addthis

April 3rd, 2011 by usage | 0

Addthis is a bookmarking and sharing site. It allows you to put buttons so your site’s visitors can share the article easily. site: http://www.addthis.com When you get the widget you will see links with “addthis_button_preferred_1” … “addthis_button_preferred_NNN” links. This is a little bit confusing if you want to have specific share buttons . Fortunately there […]