All posts by Arvind Kumar

Useful git commands or actions

Allos Overwrite

Ref. Ignoring “Your local changes to the following files would be overwritten by merge” on pull

git checkout HEAD^ file/to/overwrite
git pull

Ignoring versioned files

To start ignoring a file

$ git update-index --assume-unchanged path/to/file.txt

To start track again

$ git update-index --no-assume-unchanged path/to/file.txt

Submodules

You can pull one or all public submodules with git using the following commands :

Pull One
git submodule update --init [PATH TO SUBMODULE]
Ex. git submodule update --init c:/wamp/www/site/subfolder

Pull All
git submodule update –init,

more coming soon..

mysql-logo

Updating two columns with a subquery in MySQL

mysql-logo

Sometimes you wanted to update columns of one MySQL table by quering another MySQL table and getting a column value from the later table. For example you have a ‘students’ table and you wanted to create a new field ‘totalMarks’ in it and wanted to fill or update by taking sum of the ‘marks’ field from another table named ‘marks’. Here comes the use of subquery to update column. Continue reading

CakePHP captcha support for CakePHP 2.x and 3.x

Here is the latest CakePHP Captcha support for CakePHP Version upto 3.x.

Download for CakePHP 3.x
Download for CakePHP 2.x

NOTE:For best Image Captcha results this component requires GD and Freetype support enabled. Please check your phpinfo() to know whether your server supports this (See image below). Contact your hosting provider if any of these libraries is not enabled.

Continue reading