Git Track Untracked files


//You have made changes to the code and want to push to the remote repository

$git add .

$git status

// Now you see that some files have not been tracked

$git update-index --no-assume-unchanged /path/filename.filetype

//Error : The file couldn't be marked. To solve this issue, you can use

$git add filename.filetype

$git push _remote _branch

//Although on windows you would find issues like file path is more than 256 char and cannot be added "filename to long". for them add explicitly works.

Install MongoDB using cmd

I know its super easy to install Mongo Daemon on Ubuntu but its not that tough to run it as a service in Windows.


$Wget http://fastdl.mongodb.org/win32/mongodb-win32-i386-2.4.9.zip

//Extract the folder to /path/MongoDB

//Add /path/MongoDB/bin to the Environment variable "path"

//Create a mongo.config at /path/mongodb/mongo.config
# mongodb.conf

# data lives here
dbpath=\path\mongo\data

# where to log
logpath=\path\mongo\log\mongo.log
logappend=true

# only run on localhost for development
bind_ip = 127.0.0.1

port = 27017
rest = true
//End of the Config

//Now all set just Start your mongo daemon

$ mongod.exe --config \path\mongodb\mongo.config

$ \path\mongodb\bin>mongod --config \path\mongodb\mongo.config

//Now its time to connect to your MongoDB

$cd /path/mongodb/bin

$ mongo

//Install Mongo as Windows service
$\path\mongodb\bin mongod --config \path\mongodb\mongo.config --install

// To start the Mongo service :

$ net start MongoDB

// To stop the Mongo service :

$ net stop MongoDB

Why use template language like jade ?

If you are a developing express based NodeJs applications, Jade is the new kid in town. If you thought, it would be simple HTML converted then take  look again.

You can find the very first jade in a express application.


$ npm install -g express

$ express -c stylus App_name

$ cd App_name

$ npm install

$ cd views

// Index.jade

//Layout.jade

$ cd ..

$ nodemon app

// You can see the template representation in browser as regular HTML under page source.

Before defining the syntax basics of Jade, it is important to understand the need of a template engine :

Some benefits of Jade specifically are:

  • It’s a templating language for html, so it makes writing html less verbose and “easier” (once you’ve learned it’s syntax).
  • It supports template inheritance (which is awesome and super useful)
  • You can compile templates into re-usable functions that can be run on the server or client, passing in different data-sets and rendering them on demand (can be super nice for single-page applications).
  • You do not need a sophisticated editor to find unmatched closing tags: There are no closing tags!
  • No code formater required: indentation reflects nesting
  • You can use markdown for readable markup
  • Mixins are powerful but easy to read
  • I cannot live without block append/prepend It is useful for a template hierarchy.
  • Works perfect in combination with Angular the superheroic Javascript MVW framework
  • You can reuse jade templates

 

Convert HTML to jade :


$npm install -g html2jade

$html2jade website_address > website_name.jade

// You can use the online version - http://html2jade.aaron-powell.com/

 

The best source for Jade documentation : http://naltatis.github.io/jade-syntax-docs/

 

 

Restart node process using nodemon


$ npm install -g nodemon

$ cd App_Folder

$ nodemon app.js

//App.js is the file that uses to perform node related services.

It would behave like : During your development phase it would watch your source file and if their is any change it would restart the process for the node.

Features :

(1) Automatic restart of the application

(2) Detect specific files

(3) Ignore specific files