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
mysite/_config.php | |
<?php | |
// . . . config above | |
//Heroku ClearDB support | |
if(isset($_ENV['CLEARDB_DATABASE_URL'])) { | |
global $databaseConfig; | |
$parts = parse_url($_ENV['CLEARDB_DATABASE_URL']); | |
$databaseConfig['type'] = 'MySQLDatabase'; | |
$databaseConfig['server'] = $parts['host']; | |
$databaseConfig['username'] = $parts['user']; |
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\node\Entity\Node; | |
function ncea_preprocess_menu(&$vars, $hook) { | |
// Subjects Nav | |
if ($hook == 'menu__subjects') { | |
foreach ($vars['items'] as $key => $item) { | |
if ($vars['items'][$key]['below']) { | |
foreach ($vars['items'][$key]['below'] as $learningAreaKey => $learningAreaItem) { | |
$learningAreaUrl = $learningAreaItem['url']; |
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
@mixin hideScrollbar { | |
// https://blogs.msdn.microsoft.com/kurlak/2013/11/03/hiding-vertical-scrollbars-with-pure-css-in-chrome-ie-6-firefox-opera-and-safari/ | |
// There is a CSS rule that can hide scrollbars in Webkit-based browsers (Chrome and Safari). | |
&::-webkit-scrollbar { | |
width: 0 !important | |
} | |
// There is a CSS rule that can hide scrollbars in IE 10+. | |
-ms-overflow-style: none; | |
// Use -ms-autohiding-scrollbar if you wish to display on hover. |
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
// add overflowing text indicator for cards with longer texts | |
var win2dOptionValues = document.getElementsByClassName('win2dOption-value'); | |
for (var i=0; i < win2dOptionValues.length; i++) { | |
var curOverflow = win2dOptionValues[i].style.overflow; | |
var isOverflowing = win2dOptionValues[i].clientWidth < win2dOptionValues[i].scrollWidth || | |
win2dOptionValues[i].clientHeight < win2dOptionValues[i].scrollHeight; | |
if (isOverflowing) { | |
win2dOptionValues[i].className += " win2dOption-value--overflowing"; | |
win2dOptionValues[i].style.overflowy = "scroll"; |
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
SilverStripe\MimeValidator\MimeUploadValidator: | |
MimeTypes: | |
'json': 'text/plain' |
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 { render } from 'react-dom'; | |
import { BrowserRouter as Router, Route } from 'react-router-dom'; | |
import { createBrowserHistory } from 'history'; | |
const addScrollAnimation = () => { | |
const anchorLinks = document.querySelectorAll('[href*="#"]'); | |
anchorLinks.forEach((anchorLink) => { | |
anchorLink.addEventListener('click', (e) => { | |
const href = e.target.getAttribute('href'); |
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 VanillaTilt from 'vanilla-tilt'; | |
... | |
const initTilt = () => { | |
// init tilt | |
VanillaTilt.init(document.querySelector(".card"), { | |
max: 25, | |
speed: 400 | |
}); |
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
function camelCaseToSentenceCase(word) { | |
const result = word.replace(/([A-Z])/g, ' $1'); | |
const finalResult = result.charAt(0).toUpperCase() + result.slice(1); | |
return ( | |
<span>{finalResult}</span> | |
); | |
} |
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
<div class="filter"> | |
<label class="filter__item"> | |
<input type="checkbox" id="chkStatDraft" checked="" value="DRAFT"> | |
<span>Draft</span> | |
</label> | |
<label class="filter__item"> | |
<input type="checkbox" id="chkStatWD" value="WITHDRAWN"> | |
<span>Withdrawn</span> | |
</label> | |
<label class="filter__item"> |
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
{ | |
"name": "mpi", | |
"version": "1.0.0", | |
"description": "Ministry for Primary Industries (MPI) website.", | |
"main": "index.js", | |
"dependencies": { | |
"bootstrap": "^3.1.1", | |
"include-media": "^1.4.9", | |
"infinite-scroll": "^3.0.5", | |
"moment": "^2.22.2", |
NewerOlder