Understanding npm link

Symlink a package folder. Consider the example where you have test package inside node modules and you want to change in that package. You could make changes in node_modules and manually copy the changes to the git repository of the dependency once you are done. But there is a much cleaner approach: npm link. Package… Continue reading Understanding npm link

Disable right click on web page

One has to use JavaScript to accomplish this. If the user has JS disabled, you cannot prevent the right click. You can do it either by adding an event listener to for the “contextmenu” event and calling the preventDefault() method. Eg: or just by adding “oncontextmenu” to body tag.

Modal/Popup window in WordPress admin

If you need to create modal/popup window in WordPress admin, its easy. You can use buit-in thickbox jquery library. It’s very well documented @ https://codex.wordpress.org/Javascript_Reference/ThickBox, though lets see quick integration sample code below. Load thickbox js and css by calling function <?php add_thickbox(); ?> Add a link to html with class name ‘thickbox’ example below –… Continue reading Modal/Popup window in WordPress admin

Upgrading Ubuntu, do-release-upgrade vs upgrade

It depends on which ubuntu version you have and upgrade to? Let’s see difference first : do-release-upgrade – will upgrade to next release from version installed. Example use this to upgrade from 14.04.5 LTS to 16.04.1 LTS upgrade – upgrade will install/upgrade to latest versions of all installed packages.

Debug ionic apps installed on device using google chrome

Run following command on terminal – ionic cordova run  –device –debug Next it will ask platform, example android Then Open chrome and Web Inspector in chrome, and follow below menu path. From right side menu “Customize and contorl DevTools” -> More tools ->  Remote Devices It will show list of devices, click on your device,… Continue reading Debug ionic apps installed on device using google chrome

AWS SSL for EC2 instance

As AWS SSL certificates are free to use, just you need to use with them LB i.e. load balancers which have some cost. Let’s go through steps to integrate – Step 1 – Setup EC2 and make sure you are running any web server on it to test in the browser, so we can test… Continue reading AWS SSL for EC2 instance

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… Continue reading Environment Variables in Angular

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… Continue reading NFC technology, contactless payments future