View gist:5c1f3b2cb3e4dbb48320f433038a63eb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source: | |
plugin: url | |
data_fetcher_plugin: http | |
data_parser_plugin: json | |
urls: http://sourcesite.com/jsonapi/node/article | |
ids: | |
nid: | |
type: integer | |
item_selector: data/ | |
fields: |
View gist:117bf518de6a82ec163402e5da5689a7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create database user with name 'bob' and previously hashed mysql native password '*EE0D72C1085C46C5278932678FBE2C6A782821B4' with all database privileges | |
- mysql_user: | |
name: bob | |
password: '*EE0D72C1085C46C5278932678FBE2C6A782821B4' | |
encrypted: yes | |
priv: '*.*:ALL' | |
state: present |
View gist:872786d81fe0bc15e2cd3452d041d823
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$node = ['119' => '119]; | |
$node = $this->entityTypeManager->getStorage('node')->load(array_shift($nodes)); | |
vs | |
$node = $this->entityTypeManager->getStorage('node')->loadMultiple($nodes); |
View gist:d58702d1ba18f8233e2774f092265f75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process: | |
type: | |
plugin: default_value | |
default_value: article | |
title: post_title | |
nid: ID | |
uid: | |
plugin: default_value | |
default_value: 1 | |
sticky: |
View gist:3351f44aa8439b0f78ff2d2ff4d8782c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$entity_wrapper->field_date_project_posted->set(array( | |
'value' => $dt->format('Y-m-d'), | |
'value2' => $dt2->format('Y-m-d'), | |
)); |
View proper crud check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$node = entity_meta_datawrapper('node', $nid'); | |
$node->field_something[] = $someValue; | |
$node = $node->save(); | |
if ($node->nid) { | |
//sucess | |
} |
View gist:ebd49246c1367270bbe7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l(t('Link name you want the user to see'), 'sites/default/files/docs/docname.pdf'); or if the file is an entity (ignore this part if you are confused now) l(t('Link name you want the user to see'), drupal_get_path_alias( 'sites/default/files/docs/docname.pdf')); |
View l
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
l(t('%fieldvaluehere rest of my string', array('%fieldvaluehere' =>$field_result[0]['value'])); |
View gist:cadc023eb8c0e1b3de18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Installing homebrew..." | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Update homebrew recipes | |
brew update | |
#taps |
View gist:566daf7ea0c8d86d4dda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Copyright 2009 Empeeric LTD. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
NewerOlder