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 | |
use Drupal\taxonomy\Entity\Term; | |
$min = 2001; | |
$max = 2016; | |
for ($i = $min; $i <= $max; $i ++) { | |
$term = Term::create([ | |
'name' => $i , | |
'vid' => 'year', |
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 assign from 'object-assign'; | |
import actionTypes from '../utility/action-types'; | |
export default function = function(settings) { | |
const defaultState = { | |
config: settings.filters, | |
values: {} | |
}; | |
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 | |
use Drupal\taxonomy\Entity\Term; | |
function county_alphabetize($a, $b) { | |
return $a->properties->NAMELSAD > $b->properties->NAMELSAD; | |
} | |
$county = file_get_contents('https://raw.githubusercontent.com/kthotav/TopoJSON-Maps/master/usa/usa-states/colorado/colorado-counties.json'); | |
$json = json_decode($county); |
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 | |
$route_name = \Drupal::routeMatch()->getRouteName(); | |
$bits = explode('.', $route_name); | |
for ($i = 0; $i < count($bits); $i ++) { | |
if ($i == 0) { | |
$body_classes[] = str_replace('_', '-', $bits[$i]); | |
} | |
else { | |
$body_classes[] = str_replace('_', '-', $bits[$i - 1] . '-' . $bits[$i]); |
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 | |
function makeMatrix($columns, $rows) { | |
$matrix = array(); | |
for ($i = 0; $i < $columns; $i ++) { | |
$column = array(); | |
for ($j = 0; $j < $rows; $j ++) { | |
$column[] = 0; | |
} | |
$matrix[] = $column; |
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
if (!isset($_SERVER['HTTPS']) || strpos($_SERVER['HTTP_HOST'], 'www') === FALSE) { | |
header('HTTP/1.0 301 Moved Permanently'); | |
header('Location: https://www.creatingtransitions.org'. $_SERVER['REQUEST_URI']); | |
exit(); | |
} |
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
var _this = this; | |
chrome.cast( | |
function(data) { | |
_this.success.call(_this, data); | |
}, | |
function(error) { | |
_this.error.call(_this, error); | |
} | |
); |
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
// Don't forget export NODE_PATH=/usr/lib/node_modules:$NODE_PATH | |
var path = require("path"); | |
var pathToModules = path.resolve("/usr/local/lib/node_modules"); | |
module.exports = { | |
resolve: { | |
fallback: pathToModules | |
}, | |
resolveLoader: { | |
fallback: pathToModules | |
}, |
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 parseBool(b) { | |
if (!!(b)) { | |
return b; | |
} | |
if (b == 'true') { | |
return true; | |
} | |
if (b == 'false' || b == 0 || b == null || b == undefined) { | |
return false; | |
} |
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": "OMF-React-Stack", | |
"version": "0.0.0", | |
"description": "", | |
"main": "setup.js", | |
"dependencies": { | |
"babel-core": "^6.3.17", | |
"babel-loader": "^6.2.0", | |
"babel-plugin-transform-react-jsx": "^6.3.13", | |
"babel-preset-es2015": "^6.3.13", |