Environment Variables in Angular

Need to use different values depending on the environment you’re in? If you’re building an app that talks to the Stripe API for example, you’ll want to use your test publishable key during development and then your live publishable key in production. It’s easy to do in Angular using the environment.ts file. Angular CLI projects already use … Continued

NFC technology, contactless payments future

Hope you are watching the advertisement on TV or youtube, in which people paying bills just by hovering their credit card on POS machine. Banks like ICICI in India launched this type of cards where NFC( Near field communication ) technology is used. Lets understand NFC, two devices here one is credit card and other is POS terminal/ Card … Continued

Add new SSH users to AWS EC2

Check existing users : cut -d: -f1 /etc/passwd sudo adduser user_name add newly created to root group sudo usermod -a -G sudo user_name change current user to new user cd to home dir of newly created user run mkdir .ssh secure it by chmod 700 .ssh to create authorized_keys file run touch .ssh/authorized_keys Copy your public key in clipboard cat … Continued

Python virtualenv what why ?

virtualenv i.e. Virtual Environment, I never thought such this thing exists before working on python, but it exists and it great to avoid conflicts and maintain a separate copy of Python and libs utilized in your project. Installation – Simple – sudo pip installvirtualenv This command helps if you are taking pull of existing project … Continued

Prevent brute force attacks to WordPress wp-login page

No need to tell you to use google captcha on all forms, but still people keep trying. You can always find a plugin to get the job done, but manually you can do this too.   Generate a .htpasswd file using htpasswd generator. Do not place this file in the same location as your .htaccess … Continued

Gravity Form Date Field Filter

When you use “Gravity form date field” and want a user to select future dates or today’s date only, simply add one Html field and copy paste below code snippet to HTML field. This will be applied to all date fields in gravity form. <script > gform.addFilter( ‘gform_datepicker_options_pre_init’, function( optionsObj, formId, fieldId ) { // do stuff optionsObj.minDate = new … Continued

What is the difference between npm and bower?

npm is most commonly used for managing Node.js modules, but it works for the front-end too. Bower is created solely for the front-end and is optimized with that in mind. The biggest difference is that npm does nested dependency tree (size heavy) while Bower requires a flat dependency tree (puts the burden of dependency resolution on … Continued

Move AWS EC2 instance to a different availability region

Let’s say you setup one server in one AWS region,  moving that AWS EC2 instance to another region may result in a headache, who don’t know copying AMI instead of creating new instance and setup server, deploy code again. All I mean manually copying not required. Let’s change region of AWS EC2 – Step1: Create an AMI of … Continued

Installing Composer on OS X

Composer is a cross-platform dependency manager for PHP libraries. Let’s install it on OS X and add an alias/shortcut/command so you can use it from anywhere. Downloading Composer will create a Phar (PHP Archive) file called “composer.phar” From your terminal, run the following command: curl -sS https://getcomposer.org/installer | php // S option to show any errors if … Continued

Setup android environment var on mac os

Whenever you start with new OS installation or with a new machine and leading to android app development, we need to setup PATH environment variables. So maybe you have ‘android SDK’ downloaded or ‘android studio’ running. To add environment variables permanently, need to add those in .bash_profile file, which doesn’t exist, we need to make one by typing … Continued