This file contains 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 validateField() { | |
return{ | |
IsValidInput : function(input){ | |
var isValid = false; | |
var validChars = /^[a-z\d\-_\s\/]+$/i; | |
if (validChars.test(input)){ | |
isValid = true; | |
} | |
return isValid; | |
} |
This file contains 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
/** | |
* SVG Fixer | |
* | |
* Fixes references to inline SVG elements when the <base> tag is in use. | |
* Firefox won't display SVG icons referenced with | |
* `<svg><use xlink:href="#id-of-icon-def"></use></svg>` when the <base> tag is on the page. | |
* | |
* More info: | |
* - http://stackoverflow.com/a/18265336/796152 | |
* - http://www.w3.org/TR/SVG/linking.html |
This file contains 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 MongoClient = require("mongodb").MongoClient; | |
var url = "mongodb://localhost:27017/yourMongoDB"; | |
var data = require("./dataFile.json"); | |
MongoClient.connect(url, function(err, db){ | |
if(err){ | |
console.log(err); | |
} else { |
This file contains 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 strict' | |
const express = require('express'); | |
const http = require('http'); | |
const path = require('path'); | |
let app = express(); | |
let publicPath = path.resolve(__dirname + '/dist/'); | |
app.use(express.static(publicPath)); |
This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title></title> |
This file contains 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
const date_as_int = new Date(moment().toISOString()).getTime(); |
This file contains 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
chunk(fieldArray, size) { | |
var chunkedArray = []; | |
for (var i=0; i<fieldArray.length; i+=size) { | |
chunkedArray.push(fieldArray.slice(i, i+size)); | |
} | |
return chunkedArray; | |
} |
This file contains 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
npm install --save-dev babel-core babel-loader babel-preset-env babel-preset-react chai debug mocha request css-loader style-loader webpack-dev-server eslint eslint-loader eslint-config-airbnb eslint-plugin-react webpack webpack-cli webpack-dev-server | |
npm install --save body-parser cookie-parser cors express lodash morgan neo4j-driver react react-dom react-webpack serve-favicon uuid |
This file contains 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": "packer", | |
"version": "0.0.1", | |
"private": true, | |
"description": "API packer", | |
"scripts": { | |
"dev": "webpack-dev-server", | |
"build": "webpack", | |
"watch": "webpack --watch" | |
}, |
This file contains 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
const path = require('path'); | |
const ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
const extractSass = new ExtractTextPlugin({ | |
filename: "[name].[contenthash].css", | |
disable: process.env.NODE_ENV === "development" | |
}); | |
module.exports = { |
OlderNewer