Skip to content

Instantly share code, notes, and snippets.

View twilson63's full-sized avatar

Tom Wilson twilson63

View GitHub Profile
@twilson63
twilson63 / README.md
Last active February 16, 2020 03:06
Getting Started with React without Webpack

Get Started with React

TL;DR

Just clone this gist if you don't feel like typing...

This is a sort step by step post on how to get started with React without Webpack.

Step 1

@twilson63
twilson63 / .jshintrc
Last active October 1, 2017 19:51
Easy Vim Setup
{
"esversion": 6,
"asi": true
}
@twilson63
twilson63 / bootstrap.sh
Created July 27, 2017 14:05
Neutrino Bootstrap Instructions for Webpack/React/Redux/Tachyons/Ramda
yarn init -y
yarn add --dev neutrino neutrino-preset-react
yarn add react react-dom
yarn add tachyons react-icons animate.css redux react-redux redux-thunk ramda isomorphic-fetch react-router-dom t63
npx json -I -f package.json -e 'this.scripts = { "start": "neutrino start --use neutrino-preset-react", "build": "neutrino build --use neutrino-preset-react"}'
mkdir src && touch src/index.js src/store.js src/constants.js src/db.js
@twilson63
twilson63 / package.json
Created July 24, 2017 00:20
Module Deploy Process
{
"test": "tap test/*.js --100",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --all; git push origin --tags"
}
@twilson63
twilson63 / README.md
Last active July 19, 2017 20:29
troubleshooting-guide

Troubleshooting Guide

This is a guide on how one might go about troubleshooting problems with a web application, using tools like console.log(), chrome dev tools, the debugger, and other resources.

Setting up for success

Break a task down into small chunks. Verify each chunk. As you successfully complete a step and validate that the code works, perform a git commit to provide a historical bread crumb trail. This will narrow the scope of a potential error.

Use a linter

@twilson63
twilson63 / stop-process.sh
Last active July 14, 2017 11:57
Kill a server process running on a specific port
lsof -i TCP:3000 | grep LISTEN | awk '{print $2}' | xargs kill -9
"use strict";
/**
* Name: Calculator
* Author: Tom Wilson
* Description: This is a calculator engine that provides the ability to
* set the operators functions that will be used in the calculation process
* this gives the student the ability to create the operator functions of the
* calculator process, without having to worry about the engine.
* The main calc method takes a string as an equation:
*
@twilson63
twilson63 / setup.sh
Created May 22, 2017 13:42
My Current React Setup - 5/22/2017
export PROJECT=foo
create-react-app $(PROJECT)
cd $(PROJECT)
yarn add react-router-dom tachyons redux react-redux pouchdb-browser blocs ramda
@twilson63
twilson63 / auth-service.js
Created April 10, 2017 14:29
Auth Service PasswordLess
import { EventEmitter } from 'events'
import { isTokenExpired } from './jwtHelper'
import Auth0LockPasswordless from 'auth0-lock-passwordless'
export default class AuthService extends EventEmitter {
constructor (clientId, domain) {
super()
// Configure Auth0 Passwordless
// We’ll get the clientId and domain credentials from our .env file we created
this.lock = new Auth0LockPasswordless(clientId, domain)
@twilson63
twilson63 / auth.js
Created April 10, 2017 14:28
auth.js for redux for passwordless apps
import React from 'react'
import AuthService from './utils/auth-service'
const basicReducer = type => (state = null, action) => {
switch (action.type) {
case type:
return action.payload
default:
return state