Skip to content

Instantly share code, notes, and snippets.

View nikunjkotecha's full-sized avatar

Nikunj Kotecha nikunjkotecha

View GitHub Profile
@nikunjkotecha
nikunjkotecha / adRinger JS Code
Last active August 29, 2015 14:11
adRinger JS Code Format
<!-- adRinger JS library -->
<script type="text/javascript" src="http://<<advertiser_code>>.callsrv.in/callsrv.js?ver=1.0"></script>
<script type="text/javascript">
/* JSON object to define Parameters for reporting */
var params= {'customparam1' : 'customvalue1', 'customparam2' : 'customvalue2'};
var settings = {
"params" : params, // Optional, Custom parameters(in JSON format), Type : String, Default : null
"replace" : "my-id", // Optional, ID of HTML element to replace Number in that element once number is assigned, Type : String, Default : null
"callback" : "callback", // Optional, Custom Callback function, Type : String, Default : null
@nikunjkotecha
nikunjkotecha / adRinger JS Code Example
Created December 19, 2014 13:57
adRinger JS Code Example
<!-- adRinger JS library -->
<script type = "text/javascript" src= "http://prod-test-1.callsrv.in/callsrv.js?ver=1.0" ></script>
<script type = "text/javascript" >
/* JSON object to define Parameters for reporting */
var params= {'customparam1' : 'customvalue1', 'customparam2' : 'customvalue2'};
var settings = {
"params" : params, // Optional, Custom parameters(in JSON format), Type : String, Default : null
"replace" : "my-id", // Optional, ID of HTML element to replace Number in that element once number is assigned, Type : String, Default : null
@nikunjkotecha
nikunjkotecha / adRinger JS Code Example
Created December 19, 2014 14:01
adRinger JS Code Example
<!-- adRinger JS library -->
<script type = "text/javascript" src= "http://prod-test-1.callsrv.in/callsrv.js?ver=1.0" ></script>
<script type = "text/javascript" >
/* JSON object to define Parameters for reporting */
var params= {'customparam1' : 'customvalue1', 'customparam2' : 'customvalue2'};
var settings = {
"params" : params, // Optional, Custom parameters(in JSON format), Type : String, Default : null
"replace" : "my-id", // Optional, ID of HTML element to replace Number in that element once number is assigned, Type : String, Default : null
@nikunjkotecha
nikunjkotecha / push-platform.sh
Created March 15, 2017 06:41
Push the code from GITLAB to Platform
#!/usr/bin/env bash
set -e
# This script can be configured by specifying different environment variables in
# your .gitlab-ci.yml file's invocation of the script. If those are omitted, as
# in this example, the defaults below and throughout the script should be used.
# Check basic requirements from Config.
if [ -z "$PLATFORM_PROJECT_ID" ]; then
echo "PLATFORM_PROJECT_ID is required, please contact support if you don't know how to do it."
@nikunjkotecha
nikunjkotecha / mymodule.install.php
Created April 11, 2017 06:17
Drupal 8 - using update hook to revert view
<?php
/**
* @file
* Contains install, update, uninstall hooks for mymodule module.
*/
/**
* Implements hook_update_N().
*
@nikunjkotecha
nikunjkotecha / comment.install
Created October 6, 2017 05:33
Code reference that didn't work
<?php
/**
* Update status field.
*/
function comment_update_8300() {
$entity_definition_update_manager = \Drupal::service('entity.definition_update_manager');
$field_definition = $entity_definition_update_manager->getFieldStorageDefinition('status', 'comment');
$field_definition->setDescription(new TranslatableMarkup('A boolean indicating the published state.'))
->setRevisionable(TRUE);
@nikunjkotecha
nikunjkotecha / module.install
Created October 6, 2017 05:39
Example to demonstrate how to update field config in update hooks.
<?php
/**
* @file
* Contains install, update, uninstall hooks for module.
*/
use Drupal\field\Entity\FieldConfig;
/**
{
data: [
{
id: 1
scope: [
[
{
"key": "type",
"value": "1"
},
<?php
namespace Drupal\custom_migrate\Plugin\migrate_plus\data_parser;
use Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Json;
/**
* Obtain JSON data for migration.
*
* @DataParser(