Tuesday, May 28, 2013

Writing good code

Here I'm listing out some principles that I've picked up so far after writing code and getting them reviewed by some peers or other sites etc.
1. No repeatation
2. Try to make it as readable as possible, like try to make it look like plain English as much as possible.



Here are some links to help on that case:
1. [ http://net.tutsplus.com/tutorials/html-css-techniques/top-15-best-practices-for-writing-super-readable-code/ ]

Sunday, May 26, 2013

[PHP] Turn multiple input fields / selections into a single array

While trying to design a form so that it takes multiple inputs from text fields and multiselect selection menus, I was facing problem because even though I could handle a fixed number of fields in my script internally, what for multiple selections in a selection list?? The rescuer [] :)
Yes, just use it after the name of you input field, this way.
<select multiple class="input-medium search-query" id="autolist-filter-select" name="filter_str[]">
<input id="autolist-filter-text1" type="text" name="filter_str[]"/> <input id="autolist-filter-text2" type="text" name="filter_str[]"/>

Connect Rapoo MT750S with Linux (Tested on Manjaro)

 I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...