If you do please leave something for me :)
I hope you take something away...
Passing data within your controllers
/** * Created by nmeegama on 8/27/16. */ /************ Controller to set the data *******************/ (function (angular) { 'use strict'; angular.module('MyApp').controller('SetDataCtrl', [ '$scope', 'MyService', function ($scope, MyService) { $scope.setData = function (data) { MyService.setData(data); }; }]); })(angular); /************ Controller to get the data *******************/ (function (angular) { 'use strict'; angular.module('MyApp').controller('GetDataCtrl', [ '$scope',
Finding the JAVA_HOME in your Mac
Generally if you are not sure where your JAVA_HOME is the first thing you would do is type in the following command
echo $JAVA_HOME
But more times than usual if you have not intentionally set this variable in your MAC you would see an empty response. So now how would you proceed to find the real JAVA_HOME. Some times a quick solution is looking in /System/Library/Frameworks/JavaVM.framework/Versions. Still there can be a lot of Java HOME's in there (like what happened to me).
REST mode in Drupal 8
- Read more about REST mode in Drupal 8
- Log in to post comments
As you might already know Drupal 8 contains a web services layer out of the box. Therefore we can now easily create a RESTful Architecture by exposing Drupal's data to a third party application. REST stands for Representational State Transfer. It is a set of design principles for making network communication more scalable and flexible.
Getting rid of the CORS error with NodeJS
Ideally what I am trying to solve here is an error that usually occurs when you are trying to server data to a different domain. You will usually get an error saying something similar to the below
Cross-Origin Request Blocked
So how do we now get rid of this assuming we are using a NodeJS server to serve the data. Easy we just add the cors module. SO here is the code
Test Driven Development (TDD/BDD) with Drupal 8
Test Driven Development also known as Behaviour driven development is one of the most fast developing trends for test automation. Drupal Extension is Drupal's step towards TDD. Its a lot of big words but its something very simple.
Setting up debug mode on Drupal 8
- First copy sites/example.settings.local.php to default/settings.local.php
- Now uncomment the following lines in default/settings.php
# if (file_exists(__DIR__ . '/settings.local.php')) { # include __DIR__ . '/settings.local.php'; # }
- Now debugging is set. You also can use the following command
drupal routing:debug <route name>
This command will give the user information regarding a specific route
Backing up a PostgreSQL table
pg_dump --no-owner -d <database_name> -t <table_name> > <filename>
GIT remove ignored files
Remove ignored files using git without removing local copy
git rm -r --cached .
git add .
git commit -am "Remove ignored files"
Using Ctools modal in Drupal with Javascript
Page call back of the page ypu want to add the modal
/** * My callback function */ function my_module_my_callback() { //adding modal settings my_module_add_modal(); // add the js file to call the modal drupal_add_js(drupal_get_path('module', 'my_module') .
PostgreSQL and NOT IN
PostgreSQL treats LEFT JOIN
and NOT EXISTS
equally, using same execution plan for both of them (namely a Hash Anti Join
for the example above).
As for NOT IN
, which is semantically different since its logic is trivalent and it can return NULL
, PostgreSQL tries to take this into account and limits itself to using a filter against a subplan
(a hashed subplan
for a hashable resultset like in example above).