This file contains hidden or 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
| /* | |
| Start Bootstrap style responsive spacer helper | |
| Utilities for spacing, text and float | |
| */ | |
| $spacer: 1rem !default; | |
| $spacers: () !default; | |
| $spacers: map-merge(( |
This file contains hidden or 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 | |
| /** | |
| * Set redis configuration. | |
| */ | |
| /** @see: https://docs.platform.sh/frameworks/drupal8/redis.html */ | |
| if (extension_loaded('redis')) { | |
| // Set Redis as the default backend for any cache bin not otherwise specified. | |
| // $settings['cache']['default'] = 'cache.backend.redis'; |
This file contains hidden or 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 Drupal\my_module\Plugin\views\style; | |
| use Drupal\rest\Plugin\views\style\Serializer; | |
| /** | |
| * The style plugin for serialized output formats. | |
| * | |
| * @ingroup views_style_plugins |
This file contains hidden or 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
| use Drupal\Core\Url; | |
| use Symfony\Component\HttpFoundation\Request; | |
| function my_function() { | |
| $previousUrl = \Drupal::request()->server->get('HTTP_REFERER'); | |
| $fake_request = Request::create($previousUrl); | |
| $url_object = \Drupal::service('path.validator')->getUrlIfValid($fake_request->getRequestUri()); | |
| if ($url_object) { | |
| $route_name = $url_object->getRouteName(); | |
| // Do something with $route_name; |
This file contains hidden or 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
| // Vanilla version of FitVids | |
| // Still licencened under WTFPL | |
| // | |
| // Not as robust and fault tolerant as the jQuery version. | |
| // And also, I don't support this at all whatsoever. | |
| const vanillaFitVids = () => { | |
| // List of Video Vendors embeds you want to support | |
| const players = [ | |
| 'iframe[src*="youtube.com"]', |
This file contains hidden or 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 | |
| /** | |
| * ICS.php | |
| * ======= | |
| * Use this class to create an .ics file. | |
| * | |
| * Usage | |
| * ----- | |
| * Basic usage - generate ics file contents (see below for available properties): |
This file contains hidden or 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
| /** | |
| * @license MIT, GPL, do whatever you want | |
| * @requires polyfill: Array.prototype.slice fix {@link https://gist.github.com/brettz9/6093105} | |
| */ | |
| if (!Array.from) { | |
| Array.from = function (object) { | |
| 'use strict'; | |
| return [].slice.call(object); | |
| }; | |
| } |
This file contains hidden or 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
| import React from "react"; | |
| import ReactDOM from "react-dom"; | |
| import configureStore from "./store/configureStore"; | |
| const store = configureStore(); | |
| const rootEl = document.getElementById("root"); |
This file contains hidden or 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
| import React from 'react' | |
| import axios, { post } from 'axios'; | |
| class SimpleReactFileUpload extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state ={ | |
| file:null | |
| } |