пятница, 25 декабря 2015 г.

React.js tips.

React can either render HTML tags (strings) or React components (classes).
To render an HTML tag, just use lower-case tag names in JSX:
var myDivElement = <div className="foo" />;
ReactDOM.render(myDivElement, document.getElementById('example'));
To render a React Component, just create a local variable that starts with an upper-case letter:
var MyComponent = React.createClass({/*...*/});
var myElement = <MyComponent someProperty={true} />;
ReactDOM.render(myElement, document.getElementById('example'));
React's JSX uses the upper vs. lower case convention to distinguish between local component classes and HTML tags.

четверг, 17 декабря 2015 г.

MongoDB Default Admin Password

По умолчанию в MongoDB аутентификация отключена.

Для mongo-express используйте user:admin password:pass.
For mongo-express you should use the default account “user:admin”, “password:pass”

Чтобы включить аутентификацию , добавьте "security: authorization: enabled"  в mongo.cfg.
Добавляем администратора:
use admin
db.createUser(
  {
    user: "myUserAdmin",
    pwd: "abc123",
    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
  }
)

Arrow keys not working on Windows 10 using slc loopback

Quick resolve. Choose "Use legacy console (requires relaunch)" and compability "Windows 95" far.exe (Far Manager) shortcut properties.



пятница, 11 декабря 2015 г.

GIT error: LF would be replaced by CRLF

Проект loopback.js развернут на Windows.

Конец строки (EOL) во всех файлах Unix-style.
Как вариант исправления ошибки GIT:

$ git config --global core.autocrlf input
Подробнее 

                 | Resulting conversion when       | Resulting conversion when 
                 | committing files with various   | checking out FROM repo - 
                 | EOLs INTO repo and              | with mixed files in it and
                 |  core.autocrlf value:           | core.autocrlf value:           
--------------------------------------------------------------------------------
File             | true       | input      | false | true       | input | false
--------------------------------------------------------------------------------
Windows-CRLF     | CRLF -> LF | CRLF -> LF | as-is | as-is      | as-is | as-is
Unix -LF         | as-is      | as-is      | as-is | LF -> CRLF | as-is | as-is
Mac  -CR         | as-is      | as-is      | as-is | as-is      | as-is | as-is
Mixed-CRLF+LF    | as-is      | as-is      | as-is | as-is      | as-is | as-is
Mixed-CRLF+LF+CR | as-is      | as-is      | as-is | as-is      | as-is | as-is


Visual Studio Code cannot detect installed git

The user settings file is located here:

Windows %APPDATA%\Code\User\settings.json
Mac $HOME/Library/Application Support/Code/User/settings.json
Linux $HOME/.config/Code/User/settings.json

Just add the path to the git executable in your Visual Studio Code settings like this:

{
    "git.enabled": true,
    // Path to the git executable
    "git.path": "C:\path\to\git.exe"
}

вторник, 8 декабря 2015 г.

Установка MongoDB на Windows (Installing MongoDB on Windows)

После установки. (After install)
1. Создать файл mongodb.cfg (Create file)
systemLog:
    destination: file
    path: c:\data\log\mongod.log
storage:
    dbPath: c:\data\db
2. Создать каталоги (Create directories):
mkdir c:\data\db
mkdir c:\data\log
3. Установить службу(Install service): 
"C:\mongodb\bin\mongod.exe" --config "C:\mongodb\mongod.cfg" --install