Thursday, 30 October 2014

Need not depend on server database with GIT

if you screw things up or lose files, you can easily recover(revert your whole project to previous version know as a version controll system)


>>>>Git has 3 states
1. Committed :- saved to database
2.modified:- changed but not saved to database
3.stagged:- marked for modified and switched to new work.

some file permission logic in unix:-

there are three commands 
read is for r with value 4
write is for w value 2
execute for e  value 1

>>>>permission to a file is given by chmod permission filename.
 eg. chmod 644 file means 

6=4+2= -rw (you)
4 = -r (your group)
4 = -r (all )

so giving read access to all and your group but write access only to yourself.

so final syntax will be

 chmod (-you-group-all) file-name

where d stands for a directory or if not found is file which we can see using ll command about all files and its file permission. >>>> back to git
 if you want to track a existing project in git, you go to that project directory and type

$ git init \\ this will create a new sub directory as .git which contain all necessary repositories files.

COPYING AN EXISTING REPOSITORIES

1. $ git clone url 

2.to checkout a branch

 $ git checkout <existing-branch>

3.to create a new branch 

$ git checkout <new-branch>

4.

 $ git checkout -b <new-branch> <existing-branch>
    this will run the <new-branch> before.

>>what is a git snapshot????
 its a current content of test branch.

.>> What is a metadata???
 data that describes and give info about other data
e.g:- author, date created and date modified and file size are examples of very basic document metadata.

>>>> each file in working a working directory has two states as tracked and untracked.when will clone a repositories it will be tracked and unmodified as we just now checked them out .

tracked ----------- files in git snapshot which can  be modified , unmodified , staged.
files other that it is called untracked.

Untracked basically means
that Git sees a file you didn’t have in the previous snapshot (commit); Git won’t
start including it in your commit snapshots until you explicitly tell it to do so




 the cycle of modify->stage->commit all which were staged->modify keeps running.



5.use $ git status to determine which files are in which state



6. $ echo 'My Project' > README

    $ git status
  // its untracked
7.$ git add README // readme added to git
    $ git status // your project is now  tracked and staged to be committed.
it’s staged because it’s under the “Changes to be committed

8.after $ git init 
  type $ ls -al to see the .git in your working directory.
9. git-commit - Record changes to the repository
10.An important concept here is that Git has an 'index'

11. to set your username and email adderess
   $ git config user.email your@xxxx.com
 $ git config user.name  yourname

Wednesday, 29 October 2014

MAKE your world beautiful with BOOTSTRAP

GRID SYSTEM

1.<div class="container">

                    container

</div>

2.to make it visible use well
<div class="container">

                   <div class="well"> container</div>

</div>
3.add grey boundary to your container

<div class="container grey">

                   <div class="well"> container</div>

</div>

<style>
.grid
{
background-color:#ccc;
padding:20px;
}
</style>

4. to make it fully streched to the webpage wrap it under class grey.
<div class="grey">
<div class="container ">

                   <div class="well"> container</div>

</div>

</div>


CODING ROWS AND COLOUMN IN HTML

1. <div class="container">
             <div class="row">Row1 </div>
             <div class="row">Row2 </div>
             <div class="row">Row3 </div>
              <div class="row">Row4 </div>

  </div>

2.
 <div class="container">
             <div class="row"><div class="well">Row1 </div></div>
             <div class="row">Row2 </div>
             <div class="row">Row3 </div>
              <div class="row">Row4 </div>

  </div>

3.
 <div class="container">
             <div class="row">
                   <div class="col-lg-6">
                        <div class="well">column 1</div>
                      </div>
                    <div class="col-lg-6">
                        <div class="well">column 2</div>
                      </div>
</div>
</div>

we can have 12 columns so if we give lg-6 it means it going to have a span of 6 columns means it will cover exactly the half grid system.


now herein above we have 2 columns both covering half grid system.

4.

if you wana change the width of columns just change lg-4 in one and in another give as lg-8.


here lg stands for large in bootstrap.

note: so we can have any size columns in a row. maximum we can have is lg-1 with 12 columns and minimum lg-12 as one column or no coloumn.

eg: 4,4,2,2 will give you four columns with diff. span sizes.

5. lets take a look in controlling our grid in multiple devices also known as responsive site.

in above we have lg --- this means a large screen.
lg-6--- means there gonna be two column on a large screen.
the time you decrease size of screen it going to be a single column one below each other.



HOW CAN WE SOLVE THIS ISSUE?

a. try md -- medium instead of lg.
  so it will remain four column till a medium screen. somewhat relief hum.
 the time screen cross its limit that point is called BREAKPOINT.



b. try with sm---small (around 990pixels) and xs--- extra small (786 pixels)

c.<div class="col-xs-6 col-md-3">

this means in small screen you gona have 2 columns and in large its 6 columns.
logic: 3*4=12 so we have 4 columns
          6*2=12 we have two columns.

d. in our code we just writing a single word container inside each column.
what happen if we write large content inside  a single column and try to decrease the screen size.will it get messed up?/

YEAH IT WILL REALLY GET MESSED UP.CAN WE SOLVE IT?YEAH WATCH BELOW

1. To have a equal gaps between the rows and column we need to add a class called clearfix.

<div class="col-xs-6 col-md-3">columnjkefiudfgiiu coijfgioj jhrgio</div>
<div class="col-xs-6 col-md-3">column 2</div>
<div class="clearfix">


// if we just write clearfix it will be aplied for all screens but we don't want that to happen so  will make it hidden for lg and md as
<div class="clearfix hidden-md hidden-lg">


COLUMN OFFSET

What it means?
-- column spanning,means placng a column in you desired position.

How we do that?
-- <div class="container">  // a box not vidible to 
        <div class="row">  // a row class
           <div class="col-md-4"><div class="well">cloumn1</div></div>// left side column
           <div class="col-md-4 col-md-offset-4"><div class="well">column2</div></div>// offset or moved to right by 4 span




here we should see that 4+4+4=12 it satisfies the grid system however one of that 4 span got used in offseting the second column.


USING NESTED COLUMNS

1.to create nested column we need to create a row inside existing column

<div class="col-md-9">
   <div class="row">
      <div class="col-md-6"><div class="well"></div>
          <div class="col-md-6"><div class="well"></div>

  Now you might think the size of parent column is 9 and we are going beyond it.
but in grid system each row will be given 12 division width which is satisfied in our above code as 6+6=12.

COLUMN ORDERING

1. we can place our column in any desired position using pull and push.

            <div class="col-md-6 col-md-push">column1</div> //it will push column to 6 span right
             <div class="col-md-6 col-md-pull">column2</div>// it will pull by span 6 to left

 so the column 1 and 2 will be replaced.

making your repositories using stash in unix (CLI)

Today we  know how the relation is between a client and a software developer.
clients may need the changes anytime and anywhere and can screw your beautiful honeymoon also.


think you are working on a latest technologies on your project and suddenly a unexpected call comes from a devil client saying there is a bug found.

what all you wana do is throw your mouse out i guess!!!!!!!!!

BUT STASH IS YOUR SAVIOUR HERE

1.you can now store your new design to which you  are not yet fully committed.
2.just move your uncommitted work to a stack using below command

git stash (type in your project directory)

THIS WILL HIDE YOUR NEW CHANGES WHICH A CLIENT DONT NEED.( even i have experienced it)

3.now work on your old work and get rid of your bug send it back to client proudly ;):)

4. now to work again to your previous or new code just do 

git stash apply 
or
git stash pop

(it will restore your new code to your work and can work freely)


5. git stash clear 

6.git stash clear 

(  it will  clear all the the stash)
7.git stash drop<id> -------- drop a particular stash



stash are similar to stack and store iin top down manner.

kindly comment viewers


starting with unix

commands:-
1.$ls? - single character search
2.$ls[a-c]* - from a to c search
3.ctrl+z - come out of any bad command to your console


some vi commands:-

1. esc+/word - search word
2.        +yy      - copy line
3.        +p   - paste
4.        +dd - delete entire line
5.          +dw- delete from cursor entire line
6. :$s/A/B/g - replace A from B in your vi


echo command :-
-e : all $ value will be displayed
-n: no output trailing
\a: bell
\n: new line
\r: new line
\t:tab
\\:back slash

"": neglect $ and \
'' :unchanged
``: execute command

get value from your keyboard to a variable let it be fname

$read fname


process command


ps -ag --- all running process

kill 0 --- except shell

pstree -- tree branch


ls>first :-----  (overwrite)

ls>> ---------- exist and add



some general :------


who and wc used with pipe

who is user
wc no. of anything in a process for e.g number of users



keep in touch

top technologies a software developer must know


1.javascript
2.RDBMS
3.java
4.unix