Skip to content

Instantly share code, notes, and snippets.

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

Jibran Ijaz jibran

👨‍💻
Coding
View GitHub Profile
<?php
/**
* @file
* Boostrap for PHPUnit.
*/
use Drupal\Component\Assertion\Handle;
assert_options(ASSERT_ACTIVE, FALSE);
$autoloader = __DIR__ . '/../vendor/autoload.php';
$loader = require $autoloader;
if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
@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 / 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 / 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
<?php
$link = new Link();
$link->text = 'foo';
$link->path = 'bar';
$link->attributes = new Attribute();
$link->language = LANGUAGE_NONE;
$link->html = TRUE;
$link->query = array('foo' => 'bar');
$link->fragment => 'foo-bar';
$link->absolute' => FALSE;
@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"