Skip to content

Instantly share code, notes, and snippets.

View heddn's full-sized avatar

Lucas Hedding heddn

View GitHub Profile
<?php
/**
* @file
* Contains \Drupal\nv_migrate\Plugin\migrate\source\csv_club.
*/
namespace Drupal\nv_migrate\Plugin\migrate\source;
use Drupal\migrate_source_csv\Plugin\migrate\source\CSV;
$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
@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
// ==UserScript==
// @name SprintWeekend2015
// @namespace tagSprintWeekend2015
// @match https://www.drupal.org/node/*
// @run-at document-end
// @grant none
// ==/UserScript==
// SAVE as tagSprintWeekend2015.user.js
// Inspired by https://github.com/webflo/drupalsprint-bookmarklet/blob/gh-pages/index.html
// ==UserScript==
// @name www.drupal.org
// @namespace tagAmsterdam2014
// @match https://www.drupal.org/node/*
// @run-at document-end
// @grant none
// ==/UserScript==
// SAVE as tagAmsterdam2014.user.js
// Inspired by https://github.com/webflo/drupalsprint-bookmarklet/blob/gh-pages/index.html