February 2013
1 post
January 2013
3 posts
4 tags
Custom Query in cakePHP with Pagination
When doing large project with multiple developer working on the same repo, you tend to have duplicate of function or in this case query. Like for an example, I’m working on a project to manage customer feedback thru their website.
One of the feature requested (or obviously must have) is to be able to mark the mail as junk, thus prevent other mail from the blacklisted recipients. In my case,...
jQuery lightbox - autoload page
I just noticed that I have inbox messages this morning. One of the request is to enable “color box” onload. I’m assuming that this is refering to jQuery lightbox plugin.
You can find details of the product at this page – ColorBox - a jQuery lightbox.
In order to have the lightbox automatically load when page is loaded, you need to add the following codes to your script.
...
apitminimalistic asked: As my leader. Do you think I'm a programmer or developer?
December 2012
2 posts
3 tags
Save and strip whitespace in Textmate 2
Thanks to macromates team for giving us free Textmate2 (for paid Textmate 1 customers). I notice that I have not covered this in my dev blog, althought I did covered this for Textmate 1 in here.
It almost like the previous one where you need to create a macro for this, so here’s the steps required:
open Bundle editor by go to Bundles > Edit Bundles… menu
then press Command-N...
3 tags
Archiving codes as downloadable in zip/tar format
Most of the time we just pull repo from our Beanstalk repo when deploying to our client site. But, not all files are included due to .gitignore settings. If you are using CakePHP as your framework, it will automatically excluded the following directories like app/Config app/tmp, etc…
In order to have application-1.0.zip or application-1.0.tar.gz, you need to rely on your skill playing with...
November 2012
1 post
October 2012
2 posts
3 tags
git clone a specific remote branch →
Due to big space in our account at beanstalk, we decided to have all projects under the same company to be created under one repo. I know this is not a good practice, but for a small company with tight budget, this is they way to go.
So, since git has set the default branch as master, we need to clone a specific branch under that repo. Now I’m working on new project called DBMS2, the...
2 tags
git remove tracking local branch when push to...
I’m not sure if the title is right or wrong. I know that there’s no such thing as local tracking branch. But what I want to do is to remove the local branch from being pushed when I do “git push”. Of course you have to do “git push -u <branch>” first, so that git knows that you want to keep traking <branch> when you do push.
From the search results,...
August 2012
3 posts
4 tags
Avoiding Notices: When to Use isset() and empty() →
Good article regarding isset() and empty(). I would recommend avoid using empty() if possible and instead use strlen() for checking for empty string or array. Reason being non-assigned variables or empty assigned variables, both give the same result. I recommend you to read the article to understand when to use the isset() and empty() functions.
3 tags
Zsh and slow git completion →
I noticed that using Zsh give me slow access to my git repo or my command line for that matters. However, this fix seems to speed up my access to my git.
thanks!
5 tags
Fixing Error with Pow, RVM, Rack and Rails 3 →
So I decided to enable back POW for easy setting up rails app in my computer. POW allows you to have .dev which link back to your rails app directory. Also I’m using Powify gem by 37signals. Instead of using rbenv, I’m using RVM — don’t ask why.
My pre-rails-3 apps works ok except for latest one. Reason being, I need to add .rvmrc and .powenv in my root application...
May 2012
1 post
3 tags
Apache won't start with error - cannot modify... →
Ubuntu 12.04 LTS just relased last few days, so I decided to upgrade my current Ubuntu 11.10 to this release. If you new to Ubuntu, please take note that LTS refers to Long Term Support. In short, LTS versions are the most stable for production mode and it release one in two years time.
Well back to my issue, once i restart my apache2, it give me lots or error, this one refers to ULIMIT set at...
April 2012
1 post
4 tags
Brew PHP5.3 on OS X →
update url to => https://github.com/josegonzalez/homebrew-php
Tired of getting to re-compiled all my PHP manually, since I’m using brew for updating my rails app, just googling if the same can be done for my php app — and yes, click on the link for more details
March 2012
1 post
February 2012
1 post
November 2011
2 posts
2 tags
How to install Drush server-wide in less than one... →
in short:
sudo wget —quiet -O - http://ftp.drupal.org/files/projects/drush-7.x-4.4.tar.gz | sudo tar -zxf - -C /usr/local/share
sudo ln -s /usr/local/share/drush/drush /usr/local/bin/drush
sudo drush
enjoy!
3 tags
Installing PECL uploadprogress Extension →
I’m just updated my Drupal copy to version 7 recently and reliaze that I have not installed PECL uploadprogress library. A quick search on google give me the above url.
In short, just do the following:
Download PECL uploadprogress library (uploadprogress-1.0.3.1.tgz)
tar -zxvf uploadprogress-1.0.3.1.tgz
cd uploadprogress-1.0.3.1
phpize
./configure
make
sudo make install
next, you...
October 2011
1 post
7 tags
September 2011
7 posts
4 tags
PHP DOCUMENT_ROOT in Windows Servers
Being a Mac user somehow makes you tend to forget others in Windows world. Recently, one of my app failed to redirect my script to proper url simply because it was not be able to detect $_SERVER['DOCUMENT_ROOT'] variable. I thot I have already fixed this, but unfortunately it is not or my assumptions was wrong. So, being a lazy developer, Googling surely help me and found this solution:
// let's...
Git Is Simpler Than You Think
nfarina:
It was about one year ago that we switched to Git. Previously, we used Subversion, through the Mac app Versions, which (rightly) holds an Apple Design Award.
I made the executive decision to leave our comfy world of Versions because it seemed clear that Git was winning the Internet. There was much grumbling from my teammates, who were busy enough doing actual work thank you...
3 tags
iPhone charging but not detected by iTunes
I just notice this in the last few weeks that my iPhone does not synced with my computer. Checking on iTunes by clicking on iTunes > Preferences… > Devices tab, my Device backups list is empty. Now, that’s weird. Checking on my USB did say that it recognised my iPhone.
So, I did some googling and found out that it’s the iTunes Helper.app which have caused the issue. By...
4 tags
Plugging mcrypt into PHP →
If you had issue with phpMyAdmin regarding mcrypt module, please do the following:
download mcrypt library from http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/ not the mcrypt
then, you need to get to know your current PHP version using phpinfo(); mine is PHP-5.3.6, so I would download the following file from php.net - http://museum.php.net/php5/php-5.3.6.tar.gz
before do any...
3 tags
Linux: Set OR Change The Library Path
In short:
vim /etc/ld.so.conf.d/centos.conf
add the following path:
/usr/local/lib
to activate path:
ldconfig
to verify path:
ldconfig -v | grep /usr/local/lib
Enjoy!
8 tags
marvalle shares: Installing Ruby on Rails on... →
marvalle:
First erase old versions of ruby (comes with 1.8.5):
sudo yum erase ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs
Since Rails uses sqlite for its test applications install it:
yum install sqlite
Then install all tools needed for ruby dev:
sudo yum install…
4 tags
MySQL Error 1153 -- Got a packer bigger than...
Being a developement team, sometimes you need to do some simulation on your on notebook but to found that during the mysql migration (i’m using command line to do the import) has give me an error 1153. What is 1153 error?, well it basically inform you that during the migration, you have hit the max allowed packet. In layman term, your sql file is too big to be handled by the mysql.
In order...
August 2011
2 posts
3 tags
Upgrading to new Mongodb version
Whenever new version popups, I always wanted my system stays updated. Recently, well, I think version 1.8.3 is just around the corner, my current installation is at 1.8.0, so I just update my current version to the latest on available.
Well, instead of using the usual download/compile method, I use the software called ‘HomeBrew’ which you may download it from here:
...
3 tags
Deploying with Capistrano without Rails →
With a combination of railsless-deploy, allows other non-rails developer to use Capistrano as a tool for automating tasks on one or more servers.
July 2011
2 posts
5 tags
Safely delete Mail Attachments from Terminal
Iyup, you can safely delete all those Mail attachments previously downloaded to your hard drive. Is it safe? In my case, it works! Bare in mind, all my email are stored online, thanks to Google IMAP service which enable us to read emails and at the same time sync them no matter from which devices we read our emails. Kewl, right?
As shared by andrejK at Apple Support Communities forum, when...
5 tags
Unsupported PowerPC software alert in Lion
Iyup, when booting Mac OS X Lion, it popup alert notification on unsupported PowerPC applications. It’s a bit annoying to get such notification. So, I did some googling on the web and it turns out that Vodafone 3G USB dongle that caused the problem.
Since, there is no way to remove it using the Vodafone software, I end up manually remove the list of files as suggested by marblr site...
May 2011
1 post
Beanstalk is better on the go! New mobile web...
beanstalkapp:
For our last retreat in Spain we were asked to come up with “secret projects”. As a designer I had a hard time coming up with a feature that wouldn’t require any help from developers, but once I tried to check some commits on my iPhone I realized that viewing Beanstalk on a mobile device was exactly the thing I wanted to make better.
The result is Beanstalk’s new mobile layout....
April 2011
2 posts
2 tags
Removing Whitespace Trailing in TextMate
Recently, i notice when i do commit in git, there’s a trailing white space when saving the document. So, did some research on the net, found couple of reference in how to remove the Whitespace trailing in my document.
Basically, you need to create your own bundle which will execute the following commands:
Removing Trailing Spaces (which already included in your TextMate app, try Ctrl-Cmd-T...
March 2011
2 posts
3 tags
Installing Git
I’ve already installed Git on my machine so many times, yet I’ve not added the how-to in my tumblr. This is only for my reference only.
$ make prefix=/usr/local all
$ sudo make prefix=/usr/local install
That’s all that is need to be done. Then you can download git using the following urls:
git clone git://github.com/git/git.git
git clone...
2 tags
The PHP Benchmark →
Some info on how functions in PHP are preferred as compared to the other which will perform the same thing. Time to update codes.
Other useful links:
http://www.webdesign.org/web-programming/php/benchmark-and-optimize-php-script-speed.14875.html
#tsunami →
staff:
Our thoughts are with everyone affected by the 8.9 magnitude Japan earthquake and Pacific Ocean tsunami. Please tag your posts related to these devastating events with #tsunami.
February 2011
2 posts
3 tags
Using Sessions on Rails 3 →
let’s assume your app is Depot3,
to enable session, make change in config/initializers/session_store.rb
uncomment Depot3::Application.config.session_store :active_record_store
to create use - rake db:sessions:create
to clear use - rake db:sessions:clear
Routing for a Singleton Resource →
In short,
config/routes.rb
resource :store, :controller => ‘store
January 2011
6 posts
1 tag
git undo init
Well today, I have accidentally initialized one of my working directory as git repo. Panic, oh yes, hence the search to undo what I have done appears to be applicable.
Basically, what GIT does it when i keyed-in ‘git init’, is just add the hidden directory called ‘.git’. By just executing ‘rm -rf .git’ in my working directory helps me solve the issue.
So, in...
2 tags
RailsConf Keynote: David Heinemeier Hansson →
With the release of Rails 1.2 we take a look back at David Heinemeier Hansson’s RailsConf keynote from Chicago.
December 2010
3 posts
2 tags
Open jQuery colorbox on window load →
Using jQuery-1.4.2 with colorbox-1.3.15
$(document).ready(function() {
$.colorbox({
href: “popup.html”
});
});
2 tags
Ruby on Rails: Nesting resources by Jamis Buck →
resources :publishers do
resources :magazines do
resources :photos
end
end
Deeply-nested resources quickly become cumbersome. In this case, for example, the application would recognize paths such as
/publishers/1/magazines/2/photos/3
The corresponding route helper would be publisher_magazine_photo_url, requiring you to specify objects at all three levels. Indeed, this...
November 2010
4 posts
4 tags
Restore iPhone 4 with error 1013 and 1611
Today, I just upgrade my iPhone to firmware version 4.2.1. It went well, but just about to install the new firmware, it returns error message 1013. Doing some googling on the net, found several suggestions.
Here’s how I do it to reset my iPhone 4:
On my Mac:
Open Finder
Hold down Command + Shift keys and press ‘G’
Enter “/private/etc/” in the field and press...