Skip to content

Instantly share code, notes, and snippets.

@j-lorenc
j-lorenc / gen-project.bat
Created May 31, 2017 18:24
Project Install Script
@echo off
set /p appname="Enter App Name: "
set /p express="Express [y\n]: "
set /p react="React: [y\n]: "
set /p babel="Babel: [y\n]: "
IF %express%==y (
call express --view=hbs --css=compass %appname%
call npm install
cd %appname%
@j-lorenc
j-lorenc / webpack.config.js
Last active August 23, 2017 15:40
Default Webpack Configuration
const webpack = require("webpack");
const path = require("path");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
module.exports = {
entry: {
main: './src/js/index.js'
},
output: {
@j-lorenc
j-lorenc / index.html
Last active August 23, 2017 15:40
Template Html File
<!DOCTYPE html>
<html lang="en">
<head>
<link href="static/css/index.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<script src="static/js/bundle.js"></script>
</body>
</html>
@j-lorenc
j-lorenc / ajax.js
Last active August 23, 2017 15:39
Ajax Promise Functions
function ajaxGet(url) {
return new Promise(function(resolve, reject) {
let req = new XMLHttpRequest();
req.open("GET", url);
req.onload = function() {
if (req.status === 200) {
resolve(req.response);
} else {
reject(new Error(req.statusText));
}