A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

Author Archives: Wenbert Del Rosario

Some useful Knockout.JS examples from my JSFiddle

I am learning Knockout.js Accessing an observable array outside the foreach loop from the HTML http://jsfiddle.net/wenbert/MEKLN/ Setting a default / selected option in a Select box http://jsfiddle.net/wenbert/ZpGeS/ Working with child models http://jsfiddle.net/wenbert/Ev8H6/ Thanks to the guys at Stackoverflow and #javascript … Continue reading

Leave a comment

CakePHP 2.x: CSV File download from a database query

Here is a quick way to output/stream/download a CSV file from your database using CakePHP. For simplicity, I have placed everything in the controller. Not good practice but it quickly does the job. <?php class UsersController extends AppController {   … Continue reading


CouchDB and PHP Web Development Beginner’s Guide

CouchDB and PHP Web Development Beginner’s Guide from Packt Publishing has been released. I was a technical reviewer for the book. The book has been released more than a month ago but I was not able to announce it here. … Continue reading


WordPress: Custom post filters for Search

If you want to customize the query when doing a search in WordPress – when meta_queries are not enough. The custom “WHERE” part of the query function custom_where($where,$query) { global $wpdb;   $new_where = " /*my new where*/ $wpdb->postmeta.meta_value LIKE … Continue reading

Leave a comment

Using Javascript to Set the Image Width in Images with Responsive Layouts

The scenario Let’s say you have an image 600 pixels wide, in responsive layouts, you have to set the image width to 100% – or else it will not “adjust” to changes in the window size. On your desktop, the … Continue reading


Infinite Scrolling with WordPress

I got the chance to implement this in WordPress. The first step, install the JSON API plugin for WordPress. It can be downloaded here: http://wordpress.org/extend/plugins/json-api/ or just search “JSON API” in your WP-Admin plugins section. This plugin is really neat … Continue reading

Leave a comment

Moving to Auckland, New Zealand. Looking for a job.

Hi Everyone, My wife and I are moving to Auckland, New Zealand. I have Work-to-Resident Visa. Our departure will be on the May 13, 2012. If you are looking for a web developer then send me an email. You can … Continue reading


Ruby on Rails: Multiple file attachments with Carrierwave and Nested_form

First, I would like to thank Luca for this post. Add in Gemfile gem "nested_form", :git => ‘https://github.com/ryanb/nested_form.git’ Then run bundle install and rails g nested_form:install In my “parent” model: class Allergy < ActiveRecord::Base validates :name, :presence => true has_many … Continue reading

Leave a comment

Unable to update / upgrade anything in WordPress using Auto-Update

You are unable to upgrade automatically your WordPress installation. You are also not able to update your plugins. You have also tried everything to make your connection settings correct and it still does not work. The reason: Your PHP scripts … Continue reading

Leave a comment

Ruby on Rails: execjs Javascript runtime error when executing “rails server”

My schedule right now is not very tight and I have a couple of hours free almost everyday. So instead of playing Skyrim, I am learning Ruby on Rails. I am using RVM (http://beginrescueend.com/) on Ubuntu Ubuntu 10.04 LTS (Lucid … Continue reading