Posts

What GIT submodule update does

Your main project points to a particular commit that the submodule should be at. What  git submodule update  does is to try to checkout that commit in each submodule that has been initialized. The submodule is really an independent repository - just creating a new commit in the submodule and pushing that isn't enough, you also need to explicitly add the new version of the submodule in the main project. So, in your case, you should find the right commit in the submodule - let's assume that's the tip of master: cd mod git checkout master git pull origin master Now go back to the main project, stage the submodule and commit that: cd .. git add mod git commit -m "Updating the submodule 'mod' to the latest version" Now push your new version of the main project: git push origin master From this point on, if anyone else updates their main project, then  git submodule update  for them will update the submodule, assuming it's been initialized.

Docker

# Backup docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql # Restore cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE #create a container and link sudo docker run --name wordpress -p 8080:80 --link db_container -d wordpress here db_container is a database container

Saucelabs integration with codeception/codeceptjs

Some notes; 1. How to run Saucelabs proxy connect bin/sc -u YOUR_USERNAME -k YOUR_ACCESS_KEY bin> ./sc  YOUR_USERNAME -k YOUR_ACCESS_KEY

API.AI

some notes: There are official SDKs such as nodejs, python, HTML+javascript, Andriod Chatbot is called Agent. There are many prebuilt Agents available. Agent can be embed code in iframe. Example chatbot client: http://miningbusinessdata.com/adding-faq-chatbot-to-your-wordpress-site-using-api-ai/

Code quality analysis of Drupal. Can I use Sonar?

For better understanding: https://docs.acquia.com/article/tools-analyzing-your-drupal-codebase Following artcle my experience with Sonar and  Drupal. https://docs.sonarqube.org/display/PLUG/SonarPHP has following number of rules. Sonarway (for PHP) has following number of rules 1. Bug:15 2. Vulnerability:3 3. Code smell:45 Drupal has following number of rules 1. Bug: 3 2. Vulnerability: 0 3. Code smell: 10 Its possible that you can define following inheritance in Quality profile. For example: Sonarway=>Drupal Drupal uses PHPCodeSniffer (Drupal standards) or Coder to verify its coding standards. Both of them dont have integration with Sonar. 3. Sonar comes up with some Drupal Coding Standards. But is is not same as what we do in PHPCodeSniffer and Coder. 4. It's still better to fix critical / blocker issues from Sonar Way and Drupal Quality profiles. Its best to use PHPCodeSniffer with Drupal standards and  some repor...

Sonar Installation and using with a project

The below instruction is to run in MAC. Installation of Sonar 5.6.6 Download sonarqube and extract. > cd sonarqube-5.6.6/bin/macosx-universal-64 start sonar > ./sonar.sh console Installing sonar scanner 1. Download sonar scanner sonar-scanner-3.0.3.778-macosx 2. Add the following in ~/.bash_profile export SONAR_RUNNER_HOME="/Users/gopi/Downloads/sonar-scanner-3.0.3.778-macosx" export PATH="/Users/gopi/Downloads/sonar-scanner-3.0.3.778-macosx/bin:$PATH" 3. refresh bash profile > source ~/.bash_profile Running sonar scanner go to your projects folder where you have source code to analyze 1. Create a file sonar-project.properties with following contents # This file is used by sonar-runner # # Required metadata sonar.projectKey=myproject sonar.projectName=custom modules only, features excluded sonar.projectVersion=1.0 # Comma-separated paths to directories with sources (required) sonar.sources=. sonar.exclusions=jquery*,note...

Behat Integration with Drupal using drupalextension module

Follow the http://behat-drupal-extension.readthedocs.io/en/3.1/requirements.html for requirements and run the Selenium server $ mkdir /Users/gopi/behat $  cd /Users/gopi/behat $ curl http://getcomposer.org/installer | php Composer (version 1.3.2) successfully installed to: /Users/gopi/behat/composer.phar Use it: php composer.phar $ sudo vim composer.json {   "require": {     "drupal/drupal-extension": "~3.0" },   "config": {     "bin-dir": "bin/"   } } save the above code in composer.json $ php composer.phar install $ sudo vim behat.yml default:   suites:     default:       contexts:         - FeatureContext         - Drupal\DrupalExtension\Context\DrupalContext         - Drupal\DrupalExtension\Context\MinkContext         - Drupal\DrupalExtension\Context\MessageContext         - Drupa...