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 | |
/** | |
* Command callback. drush update-assets-via-csv | |
*/ | |
function drush_capacitype_deploy_update_assets_via_csv() { | |
$source_csv = (!is_null(drush_get_option('csv'))) ? drush_get_option('csv') : ''; | |
if (empty($source_csv)) { | |
drush_print_r('Expected parameter, csv not found.'); | |
return; |
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 | |
namespace AppBundle\Form; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\Extension\Core\Type\PasswordType; | |
use Symfony\Component\Form\Extension\Core\Type\RepeatedType; | |
use Symfony\Component\Form\Extension\Core\Type\SubmitType; | |
use Symfony\Component\Form\FormBuilderInterface; |
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 | |
# | |
# An example hook script to verify what is about to be committed. | |
# Called by "git commit" with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
# | |
# To enable this hook, rename this file to "pre-commit". | |
exec < /dev/tty |
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 | |
// thanks Dan - http://www.mediacurrent.com/blog/eight-insights-and-useful-snippets-d8-rest-module | |
/** @file | |
* Contains \Drupal\views_ext\Plugin\views\style\SerializerCount. | |
*/ | |
namespace Drupal\views_ext\Plugin\views\style; | |
use Drupal\Core\Cache\Cache; | |
use Drupal\Core\Cache\CacheableDependencyInterface; |
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/bash | |
export SEMVER_LAST_TAG=$(git describe --abbrev=0 --tags 2>/dev/null) | |
export SEMVER_RELEASE_LEVEL=$(git log --oneline -1 --pretty=%B | cat | tr -d '\n' | cut -d "[" -f2 | cut -d "]" -f1) | |
#curl -o /tmp/hub.tgz https://github.com/github/hub/releases/download/v2.2.9/hub-linux-arm64-2.2.9.tgz | |
#tar -xvzf /tmp/hub.tgz -C /tmp | |
if [ -z $SEMVER_LAST_TAG ]; then | |
>&2 echo "No tags defined" |
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 | |
$path = \Drupal::service('path.alias_manager')->getPathByAlias('/this-is-the-alias'); | |
if(preg_match('/node\/(\d+)/', $path, $matches)) { | |
$node = \Drupal\node\Entity\Node::load($matches[1]); | |
} |
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
'field_address/country_code': | |
plugin: default_value | |
default_value: US | |
'field_address/langcode': | |
plugin: default_value | |
default_value: en | |
'field_address/address_line1': streetAddress | |
'field_address/locality': city | |
# This has the form US-IN. | |
'field_address/administrative_area': |
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 | |
/** | |
* Creates a temporary table to hold values from an uploaded CSV. | |
* @param $table_name | |
* @param $columns | |
* @param $message | |
* @param $context | |
*/ | |
function csv_import_create_temp_table($table_name, $columns) { |
NewerOlder