Skip to content

Instantly share code, notes, and snippets.

View taylorstine's full-sized avatar

Taylor Stine taylorstine

  • Carnegie Mellon
  • Pittsburgh
View GitHub Profile
@taylorstine
taylorstine / webpack.config.js
Created August 31, 2016 12:17
Webpack configuration file
var path = require('path');
var fs = require('fs');
var glob = require('glob');
var _ = require('lodash');
var webpack = require('webpack');
var webpackMerge = require('webpack-merge');
var WEBPACK_PATH = require('./Constants').WEBPACK_PATH;
var WEBPACK_CLIENT_SCRIPT = require('./Constants').WEBPACK_CLIENT_SCRIPT;
var WEBPACK_SERVER_SCRIPT = require('./Constants').WEBPACK_SERVER_SCRIPT;
var WEBPACK_DEV_PORT = require('./Constants').WEBPACK_DEV_PORT;
@taylorstine
taylorstine / Compiled.js
Created August 31, 2016 12:03
The compiled file
var SpecialConsole = {
log: function(msg) {
if (proces.env.NODE_ENV !== 'production') {
console.log(msg)
}
}
warn: function(msg) {
if (process.env.NODE_ENV !== 'production') {
console.warn(msg)
@taylorstine
taylorstine / SetupErrorHandler.js
Created August 31, 2016 11:59
A file that sets up the error handler
var SpecialConsole = require('./SpecialConsole.js');
window.onerror = function() {
SpecialConsole.log("Oh no an error occurred");
}
@taylorstine
taylorstine / SpecialConsole.js
Created August 31, 2016 11:56
An example console
var SpecialConsole = {
log: function(msg) {
if (proces.env.NODE_ENV !== 'production') {
console.log(msg)
}
}
warn: function(msg) {
if (process.env.NODE_ENV !== 'production') {
console.warn(msg)
Hey there+Hey there
Hey there
Hey there
Hey there
Hey thereHey there
Hey there+Hey there
Hey there
Hey there
Hey there
Hey thereHey there
@taylorstine
taylorstine / Routes.react.js
Created May 3, 2016 12:49
Dynamic routing from server.
import ErrorPage from './ErrorPage'
import App from './App'
import ProfileController from './ProfileController'
import {isClient} from '../util'
import {Parse} from 'parse'
export default function getRoutes () {
return (
<Route path="/"
component={App}>
import ErrorPage from './ErrorPage'
import App from './App'
import ProfileController from './ProfileController'
import {isClient} from '../util'
import {Parse} from 'parse'
export default function getRoutes () {
return (
<Route path="/"
component={App}>
@taylorstine
taylorstine / Routes.react.js
Created May 3, 2016 12:36
dynamic routing
import React from 'react'
import ErrorPage from './components/ErrorPage.react'
import ReloadPage from './components/ReloadPage.react'
import Login from './components/LoginController.react.js'
import WorkoutLogController from './components/WorkoutLogController.react.js'
import ProfileSettingsController from './components/ProfileSettingsController.react.js'
import ProfileController from './components/ProfileController.react'
import ProfileSearchController from './components/ProfileSearchController.react'
import App from './components/App.react'
@taylorstine
taylorstine / server-index.js
Last active February 5, 2016 14:59
Error mail config.
var parseApi = new ParseServer({
cloud: initCloud,
appName: "My App",
databaseURI,
verifyEmails: true,
...parseParams
});
@taylorstine
taylorstine / send-email.js
Last active February 5, 2016 14:57
MailAdapter use SES
import aws from 'aws-sdk'
import path from 'path'
import fs from 'fs'
aws.config.loadFromPath(path.resolve('credentials', 'aws_config.json'));
const ses = new aws.SES({apiVersion: '2010-12-01'});
const resetEmail = fs.readFileSync(path.resolve('emails', 'reset-password.html'), 'utf8');
const verifyEmail = fs.readFileSync(path.resolve('emails', 'verify-email.html'), 'utf8');
import {MailAdapter} from 'parse-server'
import Promise from 'bluebird'