Sunday, September 30, 2012

CodeIgniter Template : Cherry on top of the icing

Just started seriously using CodeIgniter after a long time of just looking at it. I came across an amazing library called Template. It allows you to create yeah...templates for your web page. Yeah one could argue that the same concept can be achieved using views but what amazes me is how good and flexible the template library is. Having come from using grails I needed something that made my coding life a bit easier and that would also bring back the good memories that came from using grails.
So here is the link http://williamsconcepts.com/ci/codeigniter/libraries/template/index.html

Load HTML content of other website via PHP

So what if you wanted to get the html content of another website from within php...easy


$response = file_get_contents("http://www.google.com");

echo $response;

Tuesday, September 25, 2012

Forking a git repo

Forking a git repo allows you to edit someone else's code and implement awesome ideas and in turn share those ideas with the developer community out there.

So basically forking a git repo is like moving a repo from someone elses account to your account but still maintaining links to the other repo if desired. So you can still update your fork so that it is in sync with the main author's code.

To get started
  • Go to git and for the repo you want
  • Clone the repo git clone url
  • Keep track with original code by setting the upstream url git remote add upstream originalRepoUrl. You still have references to your own origin
  • Pulls in changes not present in your local repository, without modifying your files by running git fetch upstream
  • To the merge in the changes to a local branch git checkout master; git merge upstream/master