Skip to content

Instantly share code, notes, and snippets.

View heddn's full-sized avatar

Lucas Hedding heddn

View GitHub Profile
admin_toolbar: 0
admin_toolbar_tools: 0
automated_cron: 0
block: 0
breakpoint: 0
composer_manager: 0
config: 0
config_readonly: 0
config_update: 0
content_entity_base: 0
language: php
sudo: true
dist: trusty
php:
- 7
matrix:
fast_finish: true
addons:
apt:
packages:
<?php
/**
* @file
* Contains \Drupal\migrate_source_csv\Plugin\migrate\source\CSV.
*/
namespace Drupal\nica_migrate\Plugin\migrate\source;
use Drupal\migrate_source_csv\Plugin\migrate\source\CSV;
use Drupal\migrate_source_csv\CSVFileObject;
<?php
/**
* @file
* Contains \Drupal\node\EventSubscriber\NicaEntityAdminRouteSubscriber.
*/
namespace Drupal\nica_entity\EventSubscriber;
use Drupal\Core\Entity\EntityManagerInterface;
/**
* Hook to register the CKEditor plugin - it would appear in the plugins list on the profile setting page.
*/
function hook_ckeditor_plugin() {
return array(
'codemirror' => array(
// Name of the plugin used to write it.
'name' => 'codemirror',
// Description of the plugin - it would be displayed in the plugins management section of profile settings.
'desc' => t('Plugin description'),
$url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452';
$client = new \GuzzleHttp\Client;
$response = $client->get($url, [
'headers' => ['Accept' => 'application/json'],
])->getBody();
$array = json_decode($response, TRUE);
$iterator = new \RecursiveIteratorIterator(
new \RecursiveArrayIterator($array),
\RecursiveIteratorIterator::SELF_FIRST);
// Recurse through the result array. When there is an array of items at the
SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '=': SELECT map.*
FROM
{migrate_map_highest_level_education} map
WHERE (map.sourceid1 = :db_condition_placeholder_0); Array
(
[:db_condition_placeholder_0] => Universitario
)
/**
* Implements hook_form_FORM_ID_alter().
*/
function tpc_views_form_views_exposed_form_alter(&$form, &$form_state, $form_id) {
if ($form_state['view']->name == 'tpc_model_estimages') {
}
}
@heddn
heddn / 0_reuse_code.js
Created October 16, 2015 16:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
drush ev '\Drupal::entityManager()->getStorage("migration")->load("foo")->delete();'