Author: Ali Shirzad

node.js -g installing node modules globally

lately I’ve been ask a lot about node.js -g command and what does it do. It is actually referring to npm -g command which is used to install node.js modules globally, this means that the module is accessible from anywhere in a command line window (CMD) regardless of the current directory we reside in. To install a npm package or node.js module globally we can use the following:   $ npm install -g package-name It is important to understand that the -g usually used for when the node.js module or package is used through command-line utilities to put the module in bins in the system PATH, where you can execute a specific node.js command through command-line utilities and it is not used for require('./module') function. for example to install the popular simple http server module globally we can use: $ npm install -g http-server once this module is installed, you can navigate to any folder, typically a website content folder, and run http-server command and server the content of the folder to your local network.   I usually use this node.js module to test my website development and/or share files between different devices through Wi-Fi If you want to learn more about the node.js, please check out my simple node.js tutorial here. more information on npm global:...

Read More

Face Recognition on Raspberry Pi

Face Recognition on Raspberry Pi Here is a video of one of our project at University. We used a Raspberry Pi board with a compatible Pi Camera and turned into a face recognition door key. Raspberry Pi acts as a online server, where it can control a simple mechanical arm using Servo Motor and communicate with a phone application over the internet. Subscribe to find out how to create a face recognition program on Raspberry Pi....

Read More

Angular JS & Single Page Application Part 1

In this tutorial we going to start an Angular JS Application from scratch. This tutorial is aimed for beginners so we going to start from the very beginning. If you don’t know what is Angular JS please read my previous tutorial here to learn the basic concept of Angular JS and who should learn it. We start with the first setup for our project. To do this open a terminal and create a new directory and call it Contacts Project. >> cd Documents >> mkdir Contacts Project Now I’m going to assume that you already have installed Node.js and Bower. These are standard tools in web development now days so I assume you are familiar with these. If not please visit the following website and install both. https://nodejs.org www.bower.io Node allows us to run standard JavaScript on server-side and the node itself is partially written in JavaScript, which makes it really easy to integrate with angular JS. Installing Node.js will install the npm package manager that is used for backend and server-side packages and libraries. Bower is a package manager for front-end libraries and utility applications like Angular or Bootstrap that we will use for our application today. So now cd to contacts folder and lets install necessary packages and libraries for our project. First we are going to install Express JS. Express is a great server-side framework that...

Read More

Introduction to Angular JS & Single Page Application for beginners

This tutorial is the first in a series of tutorial about Angular JS as a powerful JavaScript Framework. Let’s talk about what Angular JS is. Angular JS is a JavaScript framework for creating single page applications. When you hear about it, the concept seems too complex, however if you already familiar with Modal View Controller (MVC) application frameworks it is very easy to learn Angular JS. Let’s see what are of the main concepts behind Angular JS is. First of all Angular JS is a framework, that is to create an application you follow a set of standard methods and utilize the code and libraries already provided by the framework and fast track your development by writing less codes. Angular JS offers templating, two-way bindings, filters and more. If you’re familiar with jQuery you will find Angular JS very easy and useful as they are very compatible to work together, in fact a lite version of jQuery is used within Angular. Angular JS is designed to allow programmers to create single page application which means regardless of the size of your application, browser will load a single page and additional content is loaded using Ajax or partial templates as needed which means faster loading. Angular JS has many features and advantages. Some of these features includes: Templating engine: The templating engine lets you write any html code as a...

Read More

Angular js app with PostgreSQL or MySQL using Sequelize js

Connecting your Angular JS app with PostgreSQL or MySQL Following previous tutorial on developing a simple AngularJS “ToDo” app now we want to connect our app to a database such as PostgreSQL or MySQL. Prerequisites If you don’t have any Angular JS app ready, simply follow this post to set up the basic structure of an Angular JS app. Before starting this tutorial please make sure you have your favorite database like PostgreSQL or MySQL setup and running on your PC or on a remote server to connect to. For this tutorial I am assuming you are familiar with node js and express js applications, if now read my previous posts to get started. Step 1: Installing Sequelize js Sequlize js is a ORM (Object-Relational-Mapper). The library is written entirely in JavaScript and can be easily used in the Node.JS environment. If you wondering why we are using Sequelize js, it is because it is one the best ORMs out there and if you’re developing very complex Node js app it will make your life much easier. 🙂 To install Sequelize js open any console application and navigate to your AngularJS application folder and type the following: For PostgreSQL database install: $ npm install sequelize $ npm install pg If you want to use MySQL install following: $ npm install sequelize $ npm install mysql Step 2: Creating Sequelize config file...

Read More

File Transfer App

FileTransfer by TechPrd

Access your mobile files over WiFi