Skip to content

Instantly share code, notes, and snippets.


mahesh sankhala msankhala

Block or report user

Report or block msankhala

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
msankhala /
Created Oct 13, 2019 — forked from azharuddinkhan3005/
Custom IF WBs analysis

Workbooks that were referenced during analysis.(The state of the WBs when referred to, were dated between 20th Aug - 22nd Aug 2019)

  1. UPR - Asia Shared Site - UPR - New Client Request Form_v2.0 (1)
  2. Unilever - Crown NAM - New Client Request Form - UL Domestic v2.6
  3. TWE - New Client Request Form+Custom IF with CP v16
  4. Volvo - Crown Global - New Client Request Form_Volvo_v1.4
  5. BP - Asia - New Client Request Form_British Petroleum Asia Pacific v1.6
  6. HAVI - NAM Client Configuration Workbook v1.8

CDS Mapping

After having a look into the CDS mapping sheet of the above mentioned WBs, I came across three patterns
View create-custom-info-hook.php
// Drupal 7 implement your custom hook_info()
* Gets information about a authentication module.
* @param string $module
* The module to get info for.
* @return mixed
* The information array, or FALSE if the information wasn't found.
msankhala / cloudSettings
Last active Dec 13, 2018
Visual Studio Code Settings Sync Gist For Crown
View cloudSettings
msankhala / cloudSettings
Last active Jul 3, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
msankhala / render-a-single-field-of-an-entity.php
Created Sep 11, 2018
Render a single field of an entity
View render-a-single-field-of-an-entity.php
use Drupal\node\Entity\Node;
$render = [];
$entity_type_manager = \Drupal::entityTypeManager();
$entity = $entity_type_manager->getStorage($entity_type)->load($entity_id);
$fields = [
if ($entity) {
msankhala / Trait-static-method.php
Last active Jul 21, 2018
Trait and static method.
View Trait-static-method.php
* FileGenerator.
trait FileGeneratorTrait
public static function generateFile() {
echo "generating file \n";
msankhala / DebugTest.php
Created Jun 27, 2018 — forked from mortenson/DebugTest.php
Debugging Drupal 8 Javascript tests
View DebugTest.php
class DebugTest extends YourBrokenTest {
* Overrides a broken test method and saves HTML at the point of failure.
public function testName() {
try {
msankhala /
Created May 7, 2018
symfony dependency injection cheet sheet.

Symfony Service container cheetsheet:

Passing arguments to service:

    class: App\Updates\SiteUpdateManager
    # you CAN still use autowiring: we just want to show what it looks like without

Drupal 8 Entity API cheat sheet

The examples here contain some hard-coded IDs. These are all examples. In your real code, you should already have the node IDs, file IDs, etc. in a variable.

Working with nodes

Load a node by NID:

$nid = 123;     // example value
$node_storage = \Drupal::entityTypeManager()->getStorage('node');
$node = $node_storage->load($nid);
msankhala / html5-custom-validation-pattern.js
Created May 1, 2018
View html5-custom-validation-pattern.js
jQuery('#edit-default-value-input-field-email-0-value').on('input', function(event){
var constraint = new RegExp(/^\[[\w\d][\w\d_\-]*:[\w\d_\-]*\]$/);
if (constraint.test( {
else {
this.setCustomValidity('This is not a valid token');
You can’t perform that action at this time.