Skip to content

Instantly share code, notes, and snippets.

View MrRoyce's full-sized avatar

RSH MrRoyce

  • Total Design And Technology
  • Floriduh USA
View GitHub Profile
import { createLogic } from 'redux-logic';
import * as ActionTypes from '../Types';
import {
getCategoriesSuccess,
getCategoriesFailure,
getCatSuccess,
getCatFailure,
voteCatSuccess,
@MrRoyce
MrRoyce / gist:280063164a5f744cb0ec3ecc36be84a7
Last active April 28, 2017 20:26
webpack.config.js to debug problem with Module not found: Error: Cannot resolve module 'babel-runtime'
/**
* @Author: Royce
* @Date: 2016-06-12T10:54:44-04:00
* @Email: rharding@tonight.com
* @Project: Tonight
* @Last modified by: royce
* @Last modified time: 2016-09-23T19:58:59-04:00
* @License: © 2016 Tonight LLC All Rights Reserved
*/
@MrRoyce
MrRoyce / gist:a834a0da679c9073b0d6a84cb468c566
Created September 26, 2016 21:21
WebPack error listing to debug Module not found: Error: Cannot resolve module 'babel-runtime'
> webpack --display-error-details
clean-webpack-plugin: /Applications/MAMP/htdocs/tonight/build has been removed.
ModuleNotFoundError: Module not found: Error: Cannot resolve module 'babel-runtime' in /Applications/MAMP/htdocs/tonight
at /Applications/MAMP/htdocs/tonight/node_modules/webpack/lib/Compilation.js:229:38
at onDoneResolving (/Applications/MAMP/htdocs/tonight/node_modules/webpack/lib/NormalModuleFactory.js:29:20)
at /Applications/MAMP/htdocs/tonight/node_modules/webpack/lib/NormalModuleFactory.js:85:20
at /Applications/MAMP/htdocs/tonight/node_modules/async/lib/async.js:726:13
at /Applications/MAMP/htdocs/tonight/node_modules/async/lib/async.js:52:16
at done (/Applications/MAMP/htdocs/tonight/node_modules/async/lib/async.js:241:17)
@MrRoyce
MrRoyce / gist:3ba2f36e50cab5fc8c3c17122f8c0e6d
Created September 26, 2016 21:20
bable.prod.js to debug Module not found: Error: Cannot resolve module 'babel-runtime'
const
path = require('path')
;
module.exports = {
babelrc: false,
presets: [
'babel-preset-es2015',
'babel-preset-es2016',
'babel-preset-react'
@MrRoyce
MrRoyce / gist:4f017e273f77181daaea63776b382c1f
Created September 26, 2016 21:18
package.json to debug Module not found: Error: Cannot resolve module 'babel-runtime'
{
"name": "tonight",
"version": "1.0.0",
"description": "tonight",
"main": "index.js",
"scripts": {
"build": "webpack --display-error-details",
"start": "NODE_ENV=development webpack-dev-server --progress --colors --inline",
"test": "NODE_PATH=./src mocha -R min --compilers js:babel-core/register --require ignore-styles ./tools/test_helper.js \"src/**/*.spec.js\"",
"test:watch": "npm run test -- --watch"
@MrRoyce
MrRoyce / gist:d91452527c27187ae0a5aaff48f9ccab
Created September 26, 2016 13:48
Error: Cannot resolve module 'babel-runtime' in /Applications/MAMP/htdocs/tonight
ModuleNotFoundError: Module not found: Error: Cannot resolve module 'babel-runtime' in /Applications/MAMP/htdocs/tonight
at /Applications/MAMP/htdocs/tonight/node_modules/webpack/lib/Compilation.js:229:38
at onDoneResolving (/Applications/MAMP/htdocs/tonight/node_modules/webpack/lib/NormalModuleFactory.js:29:20)
at /Applications/MAMP/htdocs/tonight/node_modules/webpack/lib/NormalModuleFactory.js:85:20
at /Applications/MAMP/htdocs/tonight/node_modules/async/lib/async.js:726:13
at /Applications/MAMP/htdocs/tonight/node_modules/async/lib/async.js:52:16
at done (/Applications/MAMP/htdocs/tonight/node_modules/async/lib/async.js:241:17)
at /Applications/MAMP/htdocs/tonight/node_modules/async/lib/async.js:44:16
at /Applications/MAMP/htdocs/tonight/node_modules/async/lib/async.js:723:17
at /Applications/MAMP/htdocs/tonight/node_modules/async/lib/async.js:167:37
clean-webpack-plugin: /Applications/MAMP/htdocs/tonight/build has been removed.
Hash: 5d841416e86a960afb3d
Version: webpack 1.13.2
Time: 58269ms
Asset Size Chunks Chunk Names
robots.txt 26 bytes [emitted]
vendor.b47001ac2219ce9e5fe0.js 3.09 MB 0, 2 [emitted] vendor
manifest.7f098e6c96f193b21664.js 763 bytes 2 [emitted] manifest
app.edc2af931ca5a3a1776b.css 16.2 kB 1, 2 [emitted] app
favicon.ico 1.15 kB [emitted]
@MrRoyce
MrRoyce / gist:097edc0de2fe001288be2e8633f4b22a
Last active October 7, 2019 09:18
AWS CodeDeploy Lamda formatter for Slack messages - node.js
var services = '/services/...'; // Update this with your Slack service...
var channel = "#aws-deployments" // And this with the Slack channel
var https = require('https');
var util = require('util');
var formatFields = function(string) {
var
message = JSON.parse(string),
fields = [],
@MrRoyce
MrRoyce / function.js
Created August 2, 2016 19:38 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
@MrRoyce
MrRoyce / axios.js
Last active July 23, 2016 19:16
React/Redux code to login a user with axios - Issue with zombie.js testing
// Login the user
export const getUserLogin = (email, password) => {
let
url = `${GT_API_URL}/login`
;
console.log('getUserLogin'); // This text appears on the log
return function (dispatch) {
dispatch(userLoginRequest());