Using Google Contacts API as server to server PHP application

You've got a website for your business and most of your new customers are reaching you via your "Contact us" form page. You're probably manually adding your customers' phone number, email, their preferred product, etc. in your Google Contacts. Would it be nice if your "Contact us" form page has the ability to save a visitor's contact and other details to the database of your account's Google Contacts app automatically? With this kind of application, server to server authentication is needed.

Override a CKEditor notification message

There are some applications that needs changing the default notification message of a CKEditor plugin. Like this case, I have application that needs to check the size of a file being uploaded against the maximum file size limit allowed on a Drupal site and the upload should abort if it exceeds. Using this upload.abort(); method will display "Upload aborted by the user." notification message which obviously not applicable to the situation. The following code snippet will override the notification generated by uploadwidget plugin:

How to setup a network printer in macOS X

I have tried the instructions available in the internet and none of them worked for me. The setup: the printer (Canon E600) is connected via USB on wireless router (ASUS WL-520gU) and Mac is running OS X El Capitan 10.11.6.

The following are the instructions:

  1. Click the Apple button at the upper left and select System Preferences from the menu.

Adding external javascript library available to all pages with query string value came from PHP in Drupal 8

In Drupal 7, adding external javascript library available to all pages with query string value came either from PHP computed value or from database this can be done by:

 * Implements hook_init()
function mymodule_init() {
  drupal_add_js('//' . variable_get('mymodule_google_map_api_key', NULL), 'external');

For Drupal 8 this is possible by:

Installing geoip2 required library for Smart IP's data source MaxMind GeoIP2 binary database

The MaxMind GeoIP2 binary database is a custom binary format and there are two available APIs that read this binary database: MaxMind DB Reader PHP API which includes an optional C extension that you may install to improve binary database lookup performance and the default is GeoIP2 PHP API. We will discuss how to install these two APIs in your system.

Passing data from PHP to javascript variable available to all pages in Drupal 8

Most of us pass data from PHP to javascript variable available to all pages in Drupal 7 is by:

 * Implements hook_init()
function mymodule_init() {
  $computed_data = mymodule_get_data();
  drupal_add_js(array('mymodule_computed_data' => $computed_data), 'setting');

We can access this data in javascript by:

Setup Drupal 8 module using Composer

Drupal uses an externally-maintained repository the but this repo is scheduled to be deprecated in January 2017 by then we will be using repo URL.

It is assumed that composer is already installed in your system. Make sure your composer version is 1.0.0 or higher, to check execute:

composer -V

If it is lower than version 1.0.0, update it by:

composer self-update

Change directory to your Drupal root path.