Skip to content

Instantly share code, notes, and snippets.

View jibran's full-sized avatar
👨‍💻
Coding

Jibran Ijaz jibran

👨‍💻
Coding
View GitHub Profile
@jibran
jibran / gist:7afa1a6d90387e5ff674b6705b71af9b
Last active January 29, 2019 05:46
Basefield scenarios in Drupal 8

There are 18 kind of different scenarios for basefield:

  1. non-translatable and non-revisionable entity with basefield with cardnality 1. One DB table: base Field column(s) in base table
  2. non-translatable and non-revisionable entity with basefield with cardnality greater than 1. Two DB tables: base, field table Field column(s) in field table
  3. translatable and non-revisionable entity with basefield with cardnality 1. Two DB tables: base, data Field column(s) in data table
    • non-translatable basefield.
    • translatable basefield.
  4. translatable and non-revisionable entity with basefield with cardnality greater than 1. Three DB tables: base, data, field table Field column(s) in field table
    • non-translatable basefield.
    • translatable basefield.
@jibran
jibran / field.field.node.article.field_der.yml
Created May 24, 2016 11:20
Difference between DER and ER fields.
uuid: 6ad5c377-24dc-4c3c-9ccf-027a87ced18f
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_der
- node.type.article
module:
- dynamic_entity_reference
id: node.article.field_der
Verifying that +jibran is my blockchain ID. https://onename.com/jibran
@jibran
jibran / my_module.install
Created April 21, 2015 06:43
Create a custom block.
<?php
function my_module_update_xxxx () {
$query = db_insert('block_custom')
->fields(array(
'body' => 'Some markup',
'info' => 'Some title for info',
'format' => 'rich_text',
));
$bid = query->execute();
@jibran
jibran / drush
Last active August 29, 2015 14:17
my drush file
#!/bin/bash
version=$(git config --get drush.version)
if [ "$version" = '7' ];
then
drush7 "$@"
else
drush6 "$@"
fi
@jibran
jibran / terms_from_term.inc
Last active August 29, 2015 14:15
Plugin to provide an relationship handler for all terms from term. plugins/relationships/terms_from_term.inc
<?php
/**
* @file
* Plugin to provide an relationship handler for all terms from term.
*/
/**
* Plugins are described by creating a $plugin array which will be used
* by the system that includes this file.
@jibran
jibran / composer.json
Created February 9, 2015 01:56
Composer file for Dynamic Entity Reference
{
"name": "drupal/dynamic_entity_reference",
"description": "Provides a field that allows an entity-reference field to reference more than one entity type.",
"type": "drupal-module",
"homepage": "http://drupal.org/project/dynamic_entity_reference",
"authors": [
{
"name": "Lee Rowlands",
"homepage": "https://www.drupal.org/u/larowlan",
"role": "Maintainer"

Keybase proof

I hereby claim:

  • I am jibran on github.
  • I am jibran (https://keybase.io/jibran) on keybase.
  • I have a public key whose fingerprint is 1BAA 8DB2 FC73 AA12 D097 9B74 ABC6 FFBD 02E0 32B1

To claim this, I am signing this object:

@jibran
jibran / .eslintrc
Last active July 19, 2017 12:14
Sample eslint file for Drupal 7
{
"env": {
"browser": true
},
"globals": {
"Drupal": true,
"jQuery": true,
"tinyMCE": true
},
"rules": {
@jibran
jibran / id_rsa.pub
Created November 12, 2013 02:49
Public ssh keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA7/ux7RQnD9gxf9cbwNBR1fUtCJ0fWNEm7b3WVDuxrvfQCPf7Aj8qq80hzXoS7zmXH36ScFi6/nugZQ/MuREbfNRZDuN5AXPNp7hIFjLFhvBvYWJOaP1f+jBIJrC1AgUPvSy+EE5mml+RETc/8p2MeiCPUjV6nXW4FfyJd4HFpal14FZN7Vfd4B6TJuUVce6WEdlZmLYT+Qtx/FFIOnl4wnf/hpR4r8/U9yjG+f4FoD/UarX4s0dG4f7oJvA1KJAFR8mRr7MrnPD4y91bTD4fYQlI+4NcItC5fMa1sent8Pcg9K55d2B2S9GE2/p09hh3pYQewI+T0pShHsvcK7JV/Q== jibran@Wolverine