I recently found myself interviewing for jobs for the first time in several years. Things have changed a bit since 2011, and the real-time or live coding interview now appears to be all the rage as a candidate screening process. This is when you are interviewed initially over the phone by someone, and then you are asked to open an online code editor app like CollabEdit, CoderPad, CodePen, or the like, and to live or real-time code your solution to one or more given problems while on the phone with the interviewer.
I recently had the need to find an element on a page based on its text content, but it needed to also be case-insensitive. Finding an element on the page based on its text is easy enough using the jQuery
:contains() selector, but the text passed to this selector must match case, letter for letter.
Instead of modifying the functionality of a core jQuery selector, I created my own custom selector called
:icontains(), where the “i” indicates case-insensitivity. I created a gist for this, shown below.
jScroll is a jQuery plugin I have developed for infinite scrolling, lazy loading, or whatever catchy phrase you may know it as. A real-world example of this behavior is your Facebook News Feed, which automatically loads content as you scroll down and reach the end of the page.
I decided to develop this plugin because I did not find any jQuery plugins out there that suited my needs precisely, or any that I could even get to work very well. For more information on jScroll and its use, please visit jscroll.com. There is no extensive documentation at this time, as the plugin is fairly simple and was developed ad hoc. I plan to continue its development and add features, however, over an indefinite period of time.
A real-world example of jScroll infinite scrolling can be seen at Hang3 | Social Classifieds.
As of version 2.0, jScroll now supports full page scrolling and auto paging once you reach the padding threshold from the bottom of the window. Window scrolling versus inside of a div scrolling is detected automatically based on the style properties of the div, i.e. if it is set to overflow “auto” or “scroll.”
Like the Facebook Page for Commit Updates
Many of us have made the mistake of sometimes forgetting to delete our
I aimed to solve this problem, and not just the problem of leaving the
One thing that is not built-in to CakePHP is the ability to use search engine friendly controller and action names when those names consist of more than one word. CakePHP does an excellent job of allowing friendly URLs in general, but this typically involves single-word controller and action names. So what about controller and action names with multiple words? In CakePHP, this is handled with class names defined in
CamelCase and method names defined in
These PHP coding guidelines are by no means an industry standard, nor are they intended to tell you PHP coders out there how things should be done. I simply want to share the PHP coding guidelines which I follow and enforce when working with other developers on larger projects.
Laying down some coding guidelines like these helps to provide a more structured and rapid development environment, and makes the PHP code more predictable and easier to debug.