$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);
$block_manager = \Drupal::service('plugin.manager.block');
https://github.com/djvirgen/virgen-acl Simple and elegant, create your own checks. No middleware?
https://github.com/OptimalBits/node_acl Use as middleware, create your own roles and access. Great choice.
https://github.com/tschaub/authorized Similar to connect roles... but a bit more robust? you can create roles and action, and associate many roles with that action
const express = require('express'); | |
const forum = express(); | |
forum | |
.get('/healthz', (req, res, next) => { | |
res.send({ name: 'forum', status: 'healthy' }); | |
next(); | |
}) | |
.get('/d/:id', (req, res, next) => { |
/** | |
* Are all the values on p present on o | |
* @param {Object} o object to search | |
* @param {Object} p object of search values | |
* @param {Boolean} [c] are loose equality matches ok? | |
* @return {Boolean} whether there are partial matches | |
*/ | |
const partialMatch = (o, p, c) => | |
Object.keys(p).every(k => | |
p[k] && o[k] |
See discussion at https://www.drupal.org/project/drupal/issues/937442
This workaround is based on code from "Address" contrib module: https://www.drupal.org/project/address Thanks to @bojanz who initially wrote it here: https://git.drupalcode.org/project/address/-/blob/8.x-1.x/address.install
This gist provides a simple JavaScript implementation of the non-standard WebKit method scrollIntoViewIfNeeded
that can be called on DOM elements.
Just use the code in index.js
in your app or website. You can see usage in the test page test.html
.
The parent element will only scroll if the element being called is out of the view. The boolean can force the element to be centered in the scrolling area.
# Taxonomy terms: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php | |
# Menu links: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php | |
# File items: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php | |
# Nodes: |
/** | |
* Sort array of objects based on another array | |
*/ | |
function mapOrder (array, order, key) { | |
array.sort( function (a, b) { | |
var A = a[key], B = b[key]; | |
/** | |
* converts a XYZ vector3 to longitude latitude (Direct Polar) | |
* @param lng longitude | |
* @param lat latitude | |
* @param vector3 optional output vector3 | |
* @returns a unit vector of the 3d position | |
*/ | |
function lonLatToVector3( lng, lat, out ) | |
{ | |
out = out || new THREE.Vector3(); |