On Development


Use Google.com Search Instead of Country Redirect Version

For those trav­el­ling with their lap­tops and have used Google search, you may have noticed that it does a coun­try redi­rect based on your IP address. For exam­ple, I vis­ited the Philip­pines this past month and instead of the usual google.com, it redi­rected and used google.com.ph. After get­ting back to the US, my searches would still redi­rect to using the .ph ver­sion. I even checked that the Search Engines set­tings (in this case in Chrome/OSX) didn’t have it.

Any­ways, in case you run into the same sit­u­a­tion, do the following:

  1. Open up Terminal
  2. Go to ~/Library/Application Support/Google/Chrome
  3. Open the file “Local State” either w/ vi or a text editor
  4. Search for the strings “last_known_google_url” and “last_prompted_google_url” and replace their val­ues to your pre­ferred Google base URL. In my case, “http://www.google.com/”.
  5. Save the file and exit
  6. Restart Chrome.

That should do the trick. For Win­dows and other sys­tems, you may check out this page for the steps. Almost the same, just dif­fer­ent paths.

Hope that helps.

Fix Full Screen Issues by Video Embedder WordPress Plugin

If you are hav­ing prob­lems try­ing to dis­play an embed­ded video(s) in your posts like me, then this might help you out. I usu­ally embed videos from Hulu, Vimeo and YouTube mostly. But it’s been a prob­lem try­ing to have the lat­ter 2 dis­play in fullscreen mode.

For Vimeo, the fullscreen icon/grpahic dis­plays on the over­lay of the video. But press­ing on it, just pauses the video and noth­ing else. For YouTube, there was no fullscreen icon/graphic in the first place. I think that might have been caused by some code changes on YouTube’s end.

Mean­while, it seems that the author of Video Embed­der, Kristof­fer Fors­gren, hasn’t been able to update the plu­gin since 2009. So for those like me who still finds good use for the plu­gin, it was a let down not find­ing any new comments/updates since August of 2009.

Con­tinue reading →

Bash Completion, Along with SVN and Git Tab Completion

Time is pre­cious. I installed these util­i­ties to save some of it:

I install bash-completion via Mac­Ports on my Macs.

sudo port install bash-completion

I then saved this svn-completion script to locally, and did a sudo cp:

sudo cp bash_completion /opt/local/etc/bash_completion.d/svn-completion.sh

Note: “bash_completion” is the file linked on “svn-completion script”. I hope that avoids confusion.

Last but not least, I then installed the git-completion script. I first checked the ver­sion of Git I have via Mac­Ports which hap­pens to be 1.6.0.5.1 I then saved and untarred the Git tar­ball of the ver­sion I have locally. Then did another sudo cp of the actual git-completion script to the same direc­tory where my svn-completion.sh is located at:

sudo cp git-1.6.0.5/contrib/completion/git-completion.bash /opt/local/etc/bash_completion.d/git-completion.sh

After that, I added the fol­low­ing to to my .pro­file (or .bash_profile):

# for bash-completion
if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion
fi
source /opt/local/etc/bash_completion.d/svn-completion.sh
source /opt/local/etc/bash_completion.d/git-completion.sh

Either restart your Ter­mi­nal, or re-execute your .pro­file, and that would do it.

For more info on Git com­ple­tion, check out this arti­cle by Kamal Fariz (bit­flu­ent).

  1. Got it by using git ver­sion. []

Git Info — Almost Like “svn info”

I have been try­ing to find some­thing like svn info but for Git. Luck­ily, I stum­bled upon Duane Johnson’s script. Here’s git-info.sh: