Amazon Ad

Saturday 12 July 2014

Creating Fault Injections For ASP.NET MVC Web API

Hi Guys,

I was working on a new project which was having a challenge to create fault injection in a running Web API.

Step 1 : Create a model Class name "User"

public class User
    {
        public int Id { get; set; }
        public string Email { get; set; }
        public string Password { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string Gender { get; set; }
    }


Wednesday 9 July 2014

Merge Git Branch

Hi guys,

Today i am going to tell you the commands to merge your branch with your live branch. Assuming that you have two branches a. Test b. Live. Where Test branch has all the development files where as "Live" branch has the data of the live website. Here is how we can merge these two branches.

1. git pull origin test
2. git checkout live (in case the branch is not in local rep. then use git checkout -b live)
3. git branch (To check which branch is current branch. The live branch will be your current branch)
4. git add .
5. git commit -m "message"
6. git status
7. git merge test (Merge the live branch with test branch)
8. git pull origin live
9. git push origin live
10. git pull origin live

In case you want to pull all the live contents on to your local repository :
git reset --hard origin/test
This tells it to fetch the commits from the remote repository, and position your working copy to the tip of its master branch. The above command will replace all the local files from "test" branch with all the files on the Github remote branch "test".

Thanks
Ritesh

Thursday 3 July 2014

Selectize.js Dependent Dropdowns For Country And City

Hi Guys,

I was working with selectize.js and a problem occurred when i was using select/dropdown list, I was working in PhP. Here is the code for country dropdown which successfully loads city on selecting country from country dropdown.

<div class="form-group mb10">

        <div class="row">

            <div class="col-sm-6 mb5">

                <label class="control-label">Country</label>

                <div class="has-icon pull-right">

                    <?php echo CHtml::dropDownList('ClientProjects[country]','',CHtml::listData(States::model()->findAll(array('order'=>'name ASC')),'id', 'name'),array('class'=>"form-control pr10",'prompt' =>'Select Country','id'=>"country",'ajax'=>array(

'type'=>'POST',

'url' => CController::createUrl('/globaldata/getCity'),

'data'=> array('country'=>'js:this.value'),

'success'=>'function(data){loadcity1(data);}'

)

));?>

                 </div>

            </div>

How to avoid reentering of github user and password when pull or push

Hi Guys,

I was facing a problem when i was working on a project on github. The pull and push git commands were asking me my github username and password when i pushed or pulled the branch. Following are the steps :

Step 1 : Remove the already added origin if any by using this command

>git remote rm origin

Step 2 : Now we will add an origin with username and password, This will get stored in the git file and won't ask the username and password again.

>git remote add origin https://username:password@github.com/organizationname/repositorypath

where username is your github user name and password is the password of your github user. In case you cannot find the organizationname and repositorypath, You can find this by copying the https clone URL of the repository. i.e incase your your URL is "https://github.com/riteshtandon23/MyCodio.git" having username as "test" and password as "test123" then your git command will be


>git remote add origin https://test:test123@github.com/riteshtandon23/MyCodio.git

Step 3 : Give a command to pull the branch on local

>git pull origin master

It won't ask you any login or password same will happen with the push command.

> git push origin master

Hope it helped you.a

Thanks
Ritesh

How to implement Captcha v3 in ASP.NET

 I was facing an issue of dom parsing in my website. I finally resolved it by using Google Captcha V3. Step 1: Get your keys from https:...