Author name: Yang Yang

Hello, I'm Yang. I build online businesses that please people. Want to join in and post some useful articles on Kavoir.com? Shoot me a message.

CSS: Styling WordPress Administration Control Panel Buttons

WordPress does a great job in smoothing the user experience of the blog administration control panel. Ever wonder how they have styled all those buttons with such touchy appearance? Well the originator is the man in blue: button { border-left: 3px double #CCCCCC; border-right: 3px double #999999; border-top: 3px double #CCCCCC; border-bottom: 3px double #999999; …

CSS: Styling WordPress Administration Control Panel Buttons Read More »

The Secure Way to Store Passwords with PHP

Passwords are indisputably one of the most sensitive data types to deal with for web developers, especially back end developers who are in charge of PHP and MySQL. Storing passwords is not tricky considering you are just required to do a one-way conversion of them: $password = ‘ilovjenny84’; $salt = ‘SHAKY SHARKY 333’; // whatever …

The Secure Way to Store Passwords with PHP Read More »

Pair.com Hosting Coupons and Promo Codes (Bonus: Pair.com Control Panel Screenshots)

Well the title may be a little misleading in that I got only one working hosting coupon of Pair.com. I haven’t personally purchased any service from this hosting company but almost all the reviews about them I came across are positive. To waive the setup fee and enjoy a 10% discount, use the coupon: THG …

Pair.com Hosting Coupons and Promo Codes (Bonus: Pair.com Control Panel Screenshots) Read More »

phpBB: Disabling User Registrations / Signup

There might be a possibility that you want the current users to keep engaging with each other in the phpBB forum and to disable further user registrations. To disable user registration, simply log in the phpBB administration panel and go to: ACP => General => User registration settings => Account activation => disable While it …

phpBB: Disabling User Registrations / Signup Read More »

jQuery: Protecting or hiding variables / functions in a specific local scope

As everyone who’s well trained in software engineering would agree, that one of the principle of writing predictable code is to separate and hide something within only the scope that it’s needed. Controlled access to and from the outside world brings predictability and accountability of your code thus better debugging. In jQuery, you need constantly …

jQuery: Protecting or hiding variables / functions in a specific local scope Read More »

jQuery: Get the text and value of the selected option of HTML select element

For instance, there’s a HTML select element identified by the ID #title, and after the user has selected one of the options, you want to get the text and value of the selected option. <select id="title"> <option value="1">Mr</option> <option value="2">Mrs</option> <option value="3">Miss</option> </select> Now that the user has selected the 2nd option: Mrs. To get …

jQuery: Get the text and value of the selected option of HTML select element Read More »

jQuery: How to check if an element has a particular class

To know whether a class exists on an element with jQuery, you need a simple test method: is(). For example, to test if an element #elm has the class ‘first’: if ($(#elm).is(‘.first’)) { //#elm has the class } else { //#elm doesn’t have the class } jQuery is() is the function that checks if any …

jQuery: How to check if an element has a particular class Read More »

jQuery: How to test or check whether an element exists

.length property in JavaScript returns the length or number of elements inside an array or the string length. While jQuery selector mechanism $(“elm”) returns an array of DOM objects (such as elements), you can also get the number of the length of the returned objects array by: $("#some").length To check the existence of the element, …

jQuery: How to test or check whether an element exists Read More »

jQuery: Selecting elements with uncommon / special characters in ID or class name

HTML generated by some CMS or frameworks include elements with rather uncommon characters in ID or class names. For example, some may have special characters such as ‘.’ or ‘[..]’ in the ID or Class. To work around this, a selector in jQuery should be written this way: $(“$some.id”) // won’t work for ID: some.id …

jQuery: Selecting elements with uncommon / special characters in ID or class name Read More »

Set Expiration or Expiring Time by mod_expires.c on Apache via .htaccess to Reduce Web Page Loading Time

When your site’s ready in design and majority of common media resources won’t change for quite some time, say, half a year, for example, the images and flashes. It makes sense to set the expiration of them much longer than the default to prevent the client browsers downloading them every time a visitor drops by, …

Set Expiration or Expiring Time by mod_expires.c on Apache via .htaccess to Reduce Web Page Loading Time Read More »

Validate and Check Your Site’s Accessibility against WAI (WCAG) and Section 508

If you are determined to make your site comply with the latest provisions in the accessibility code, you may find it’s a pain in the ass to check point by point against the checklist of WAI (Web Accessibility Initiative) and Section 508. Yep, it sure is with so many check points for your web page …

Validate and Check Your Site’s Accessibility against WAI (WCAG) and Section 508 Read More »

How to know if your hosting provider is overselling on your server?

To check whether you are one of the victims that are dwelling on oversold web hosting servers, you need to have SSH access to your server. Now perform the following commands: cat /proc/cpuinfo | grep processor | wc -l Which will usually return the number of the CPUs of the current server: 2 Then, display …

How to know if your hosting provider is overselling on your server? Read More »

Scroll to Top