Thursday, January 21, 2016

Friday, July 10, 2015

Create gitignore menually in window

To get around this I used the following steps
  1. Create the text file gitignore.txt
  2. Open it in a text editor and add your rules, then save and close
  3. Hold SHIFT, right click the folder you're in, then select Open command window here
  4. Then rename the file in the command line, with ren gitignore.txt .gitignore

Thursday, June 11, 2015

Email settings In CAKE

public $default = array(
        'transport' => 'Mail',
        'from' => 'support@[sitename].com',
        'additionalParameters' => '-fno-reply@[sitename].co.in',
    );

[sitename] replace with actual site name.
from is a valid email address.

Monday, May 4, 2015

Delete all between string From and TO

function delete_all_between($beginning, $end, $string)
    {
        $beginningPos = strpos($string, $beginning);
        $endPos = strpos($string, $end);
        if ($beginningPos === false || $endPos === false)
        {
            return $string;
        }

        $textToDelete = substr($string, $beginningPos, ($endPos + strlen($end)) - $beginningPos);

        return str_replace($textToDelete, '', $string);
    }

CAKEPHP Model validation of Complex Password

CAKEPHP Model validation 

'password' => array(
            'passlength' => array(
                'rule' => array('between', 6,15),
                'message' => 'Password should consist of 6-15 characters.'
            ),
            'passwordComplexity' => array(
                'rule' => array('passwordComplexity'),
                'message' => 'Must contain mixed-case letters, numbers and special characters @#!$&*_'
            ),
        ),

public function passwordComplexity($field = array())
    {
        if (isset($this->data[$this->alias]['password'])){
            $pattern = '/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W)(?!.*\s).{6,20}$/i';
            $subject = $this->data[$this->alias]['password'];
            if (!preg_match($pattern, $subject)){
                return false;
            }
        }
        return true;
    }


VALIDATION regex 

with 41 Step
/^(?=.*[A-Z])(?=.*[!@#$&*_])(?=.*[0-9])(?=.*[a-z])(?!.*\s).{6,20}$/i

with 38 Step
/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W)(?!.*\s).{6,20}$/i

For More Help : 
http://www.rubular.com/r/pJRmWeFvKk
https://regex101.com/

Wednesday, November 12, 2014

Some Word About "Caption NEMO"


The League of Extraordinary Gentlemen is based on a comic-book miniseries by graphic-novel-writing legend Alan Moore and artist Kevin O’Neill, which chronicles the collective adventures of late-19th-century fictional “superheroes”: Mina Harker of Bram Stoker’s Dracula, Alan Quatermain of H. Rider Haggard’s King Solomon’s Mines, H.G. Wells’s Invisible Man, Robert Louis Stevenson’s dualistic protagonist from The Strange Case of Dr. Jekyll and Mr. Hyde and Jules Verne’s enigmatic Captain Nemo. Notably, the books depict Nemo—for the first time in pop culture—wearing Indian (specifically, Sikh) attire. Although disavowed by Moore and poorly received by critics, the film adaptation does feature the only Nemo played by an Indian actor, Naseeruddin Shah. Reviewers unfamiliar with Verne’s work declared Shah’s casting innovative.


Most adaptations depict Nemo as older than in the novels and more serious—except for the 1974 television cartoon The Undersea Adventures of Captain Nemo, which reimagines him as the heroic, conventionally handsome blond ocean researcher Mark Nemo. This is perhaps no worse a representation than those by celebrated English actors James Mason, Michael Caine and Patrick Stewart, all of whom played Nemo with a British accent—implying kinship with the nation Verne’s captain despises.


 Finally, Caption NEMO is best hero for me -- DHARMENDRA BAKRECHA

Nathuram Godse - The Man Who Killed Gandhi

Nathuram Godse - The Man Who Killed Gandhi (The Other Side of The Story)