It’s an example of useful jQuery way to limit user entering a maximum set number of character in your input fields. Example makes use of javascript substring function to limit user upto 20 character which is triggered on keyup event.…
Getting a way around the “No protocol specified, …cannot open display:0.0” message
After doing sudo su – (to give myself root privileges) when I tried editing a file using gedit info.txt it would show me the following error message:
How to get current theme name or theme working in cakephp
Making theme set and available by setting theme related properties in controller Prior to cakephp 2.0 class UserController extends AppController { var $view = ‘Theme’; //tells controller to use “ThemeView” class instead of the default “View” class var $theme =…
Get post thumbnail out side of the Loop in wordpress
Just got a way to get the post thumbnail outside of the Loop which (the thumbnail) was entered through the Post Image > Set the URL for an image/icon for this post: field on Edit Post page. Here it is.…
Conditional skip for a field from model validation in a cakephp controller
In a controller, a table field could be skipped from model validations by editing the “validate” property of a model. For example, i have a “date” validation for “dob” (date of birth) field set in my “User” model.
A note on $form->dateTime(‘field_name’) generating offset warning in CakePHP
This is a note on $form->dateTime(‘field_name’) generating offset warning i.e. “Notice (8): Undefined offset: 1 [CORE/cake/libs/view/helpers/form.php, line 1836..“. If your “date” form field in a view is generating a similar warning you may need to look into the following scenario.
Finding files using ‘find’ command in Linux
Here’s a list of most useful linux “find files” commands i have summarized recently. Finding files with filename Find file by exact name $ find / -name ‘script.php’
How to debug a php application in production/live mode
How to debug a live website built in php? Here’s a basic, simple and custom method i usually use to debug live or production web applications (web sites). First of all i place the following lines of code in a…
Keyboard shortcuts to switch among split views in jEdit
Here’s the keyboard shortcuts to navigate or switch among split views or text areas or window panes (whatever you call it) in jEdit. Alt-Page Up Send keyboard focus to previous text area. Alt-Page Down Send keyboard focus to next text…
Fixing “empty characters with grayed background” in LibreOffice document content
I copied one of my email’s content into a LibreOffice document for saving as a .doc or .docx. While looking at the pasted content it was weird to have a lot of empty spaces(tabs, spaces and/or newline characters, whatever) with grayed background…