Skip to content

Instantly share code, notes, and snippets.

@jasonbell
jasonbell / bar.php
Created September 10, 2020 04:42 — forked from AllieRays/bar.php
Programmatically create multiple taxonomy terms in Drupal 8
<?php
// Programmatically create taxonomy terms for taxonomy module on install.
// This is the bar.install file included in a module.
use Drupal\taxonomy\Entity\Term;
use Symfony\Component\Yaml\Yaml;
function foo_taxonomy_install() {
$vocabularies = [
@jasonbell
jasonbell / create-geojson-for-loop.js
Last active September 26, 2017 15:08 — forked from mapsam/geojson.js
Create a GeoJSON structure in for loop
var geojson = {};
geojson['type'] = 'FeatureCollection';
geojson['features'] = [];
for (var k in data) {
var newFeature = {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": parseFloat(data[k].lng), parseFloat(data[k].lon)]