Posts

Angular login registration example

Reference http://jasonwatmore.com/post/2018/05/16/angular-6-user-registration-and-login-example-tutorial

MySql Command Cheatsheet

First time setup https://linuxize.com/post/install-mysql-on-centos-7/ **************************************************************** Setup initiate Open terminal and edit  /etc/mysql/my.cnf sudo nano / etc / mysql / my . cnf Underneath the  [mysqld]  section.add: lower_case_table_names = 1 Restart mysql sudo / etc / init . d / mysql restart **************************************************************** Remove mysql completely Execute the following command : # rpm -qa | grep mysql It will list all installed mysql packages on your system. Eg:  mysql-libs-5.1.73-3.el6_5.x86_64 now execute the command: # yum remove <name displayed in above step-1> Eg:  yum remove mysql-libs-5.1.73-3.el6_5.x86_64 **************************************************************** > mysql -u root -p > CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; > GRANT ALL ON db1.* TO 'username'@'%'  ...

Express connect to mysql

MySQL Module :  mysql Installation $ npm install mysql Example var mysql = require ( 'mysql' ) var connection = mysql . createConnection ( { host : 'localhost' , user : 'dbuser' , password : 's3kreee7' , database : 'my_db' } ) ; connection . connect ( ) connection . query ( 'SELECT 1 + 1 AS solution' , function ( err , rows , fields ) { if ( err ) throw err console . log ( 'The solution is: ' , rows [ 0 ] . solution ) } ) connection . end ( ) Reference https://expressjs.com/en/guide/database-integration.html https://www.terlici.com/2015/08/13/mysql-node-express.html https://codeburst.io/build-a-rest-api-for-node-mysql-2018-jwt-6957bcfc7ac9 https://github.com/waiyaki/postgres-express-node-tutorial/blob/master/ http://docs.sequelizejs.com/manual/tutorial/models-usage.html#data-retrieval-finders

Express by Node.js

It is a web application framework. Install go to the directory of app > mkdir api > cd api > npm init > npm install express --save > node app.js Or install via Express Generator generator tool,  express-generator , to quickly create an application skeleton. #1  The  express-generator  package installs the  express  command-line tool. Use the following command to do so: npm install express-generator -g cd .. //go to parent path #2 For example, the following creates an Express app named  api . The app will be created in a folder named  api in the current working directory and the view engine will be set to  Pug : express --view=pug api #3 Then install dependencies: $ cd myapp $ npm install #4 Run the app > set DEBUG=myapp:* & npm start In case, need to monitor change install nodemode > npm i -g nodemod > nodemon app.js //instead of calling npm start //Nodemon will watching for changing ...

Angular JS

Reference: https://www.youtube.com/watch?v=UzvyuYEAU8o Source Code: https://www.dropbox.com/sh/pxn8os58g00filr/AAAenHvG5hnjwdAt9Uqd6n2Ia?dl=0 CDN UI-Bootstrap Link : https://cdnjs.com/libraries/angular-ui-bootstrap Install >npm install angular@1.5

Angular 6

Image
Prerequisite - Node Js Command > npm -v //check nodejs version > npm install -g @angular/cli  //install angular client > ng new app --style=scss --routing   //create application, default style=css, add routing flag to create routing file\ > ng serve -o   //start server File 1. index.html (specify app-root) 2. app.component.ts (descript app-root which contains ...)    2.1 app.component.html    2.2 app.component.scss Add component > ng generate component sidebar  OR > ng g c posts //create file necessary files e.g. html, scss, ts Add service > ng generate service data Install angular animation >npm install @angular/animation@latest --save Build >ng build //To reduce the size >ng build --prod This will create /dist folder under project folder However, you may have to change base href at index.html e.g.  <base href="/ng7/dist/ng7/"> ---------------------------------- ...