How To Use EJS with Express

In this tutorial, we are going to configure EJS template engine in Express/Node application.

To install EJS inside your ExpressJS project follow the steps given below,

01. Navigate to your project folder and run the following command,

npm install ejs --save  

02. Now, you need to set ejs as your default view engine. You can do this by using following code.

app.set('view engine', 'ejs');

Read Also: Angularjs filter To Output Plain Text Instead Of HTML

Disable “Install the WooThemes updater plugin to get updates”

Here’s a single line code which allows you to get rid of annoying WooCommerce admin notices i.e “Install the WooThemes updater plugin to get updates for your WooThemes plugins”.

All you need to do is copy the following code snippet and paste it inside your functions.php file located inside your themes directory.

remove_action('admin_notices', 'woothemes_updater_notice');

Something you may not know: How to Hook Into WooCommerce to Trigger Something After an Order is Placed

WordPress Asks for FTP Details While Installing Plugins

When you setup a WordPress on Ubuntu Linux and try to install a new plugin from plugin repository it prompts you for FTP Details.

With a few Google searches I managed to find a solution for this problem. To fix this issue all you need to do is run the following command on your terminal.

sudo chown -R www-data:www-data /[folder-path]/[name-of-your-project-folder]

You can also fix this issue by adding following line to your wp-config.php file.

define('FS_METHOD', 'direct');

See Also: How to Get Featured Image Thumbnail URL Using WP REST API

Git Ignore File Permission

When you clone a git project on Ubuntu, you need to change its permissions to make it editable. The problem with doing this is by default git tracks file permission changes and consider it as modification in file. However, there is simple trick which you can use to stop git to ignore changes in file permission.

We can force git to ignore file permissions by running this command inside your terminal.

git config core.fileMode false

You can also set it as global cofiguration by using following command.

git config --global core.filemode false

See Also: Remove Author From WordPress Recent Comments Widget

Installing Git on Ubuntu

In this tutorial, we are going to install Git version control system on Ubuntu. To install Git on Ubuntu follow the steps given below.

Step 01.

In the first step, you need to add PPA to your Source list.

add-apt-repository ppa:git-core/ppa

Step 02. 

Now run the following command to update your soruce list

apt-get update

Step 03.

Now, run the following command to start the installation process

apt-get install git

Read More: How to Remove a Package From Laravel Using Composer

How to Remove a Package From Laravel Using Composer

We have already discussed how we can install packages and dependencies using Composer dependency manager. In this tutorial, we are going to see how we can remove existing packages from Laravel.

To remove a package navigate to your project folder and use the following command.

composer remove vendor/package

Example:

let’s say, I want to remove the HTML and Form builder package from my Laravel app. Then I need to run the following command.

composer remove laravelcollective/html

Where laravelcollective is the vendor name and html is the name of the package. Also, you need to remove references to that package from providers and aliases arrays from within the app.php.

Top 5 Free Code Editors For Web Developers

Code editors have a really heavy impact on the way developers right code. It plays an important role in reducing the errors and speeding up the coding process. There are tons of code editors out there with amazing features like syntax highlighting, code folding, directory tree view and many more which makes your coding much more fun. Here’s a list of top 5 code editors which I prefer to use.

Notepad++

notepad++

notepad++

Notepad++ is one of the most popular, open source and lightweight code editor available today. Personally, I have used Notepad++ for long time. It is very easy to use and comes with many built in features like Syntax highlighting, code folding etc.

Brackets

brackets.io

brackets.io

Brackets is a free and open source editor from Adobe Systems. It is released under MIT License. It is avaliable for Windows, Linux and Mac operating systems.

Komodo Edit

komodo-edit

komodo-edit

Komodo Edit is a free code editor from ActiveState. It comes with a lots of amazing features like syntax highlighting, directory tree view, code folding and much more.

Atom

atom.io

atom.io

Atom is free and open source text editing application from Github. It is desktop application written in web technologies. It supports a wide variety of languages including PHP, Ruby, JavaScript, Objective-C etc.

Bluefish

bluefish

bluefish

Bluefish is another free code editor application distributed under GPL license. It comes with features like Syntax highlighting, Auto-completion and much more.

How to Display Author’s Gravatar on Single Post in WordPress

Here’s a tiny WordPress code snippet which allows the developers to display Post Author’s Gravatar image on individual post. In this code we are using get_avatar() function.

<?php echo get_avatar( get_the_author_meta( 'ID' ), '80' ); ?>

Where the get_the_author_meta( ‘ID’ ) function will return author ID for the author of current post and 80 is the height and width of image the above code will generate. You can also pass Author’s email address as first parameter instead of Author’s ID.

Useful Read: How to Change Author URL Base in WordPress

Using Bootstrap Tooltip With AngularJs

Tooltip is a tiny popup box that appears when the user hovers his cursor over a specific element. In this tutorial, we are going to use Bootstrap’s tooltip component in our AngularJs application. For this tutorial, we are using UI Bootstrap components.

To integrate Bootstrap Tooltip within your AngularJs application follow the steps given below:

Step 01:

Link Bootstrap Stylesheet file.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

Step 02:

Load AngularJs and UI Bootstrap files within your application.

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js"></script>
<script src="ui-bootstrap-tpls-1.3.2.min.js"></script>

Step 03:

Include the module within your project by adding ui.bootstrap as a dependency.

angular.module('myApp',['ui.bootstrap']);

Step 04:

Now, finally to add the Bootstrap tooltip use uib-tooltip attribute.

<button tooltip-placement="bottom" uib-tooltip="Hello World!">Hover Over!</button>

Useful Read: Make Bootstrap Popover Appear/Disappear on Hover Instead of Click

Resource: https://angular-ui.github.io/bootstrap/