Skip to content

Instantly share code, notes, and snippets.

View stephencweiss's full-sized avatar
🎉

Stephen Weiss stephencweiss

🎉
View GitHub Profile
@stephencweiss
stephencweiss / .zshrc
Created October 5, 2018 20:35 — forked from olund/.zshrc
My .zshrc file
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="intheloop"
# Example aliases
@stephencweiss
stephencweiss / create-react-app-error-message-6
Created October 23, 2018 15:18
Step 6 of the debugging suggestions
6. Check if /Users/Stephen/node_modules/babel-loader is outside your project directory.
For example, you might have accidentally installed something in your home folder.
@stephencweiss
stephencweiss / create-react-app-error-message
Last active October 23, 2018 15:21
React Error Message
```bash
Stephens-MBP:new-tic-tac-toe Stephen$ npm start
> new-tic-tac-toe@0.1.0 start /Users/Stephen/Documents/_coding/reactTicTacToe/new-tic-tac-toe
> react-scripts start
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
$ nvm use system && npm ls -g --depth=0
Now using system version of node: v8.12.0 (npm v6.4.1)
/usr/local/lib
├── bower@1.8.4
├── browserify@16.2.3
├── eslint@5.6.0
├── js-beautify@1.7.5
├── live-server@1.2.0
├── moment@2.22.2
$ npm start
Compiled successfully!
You can now view react-pos in the browser.
Local: http://localhost:3000/
On Your Network: http://192.168.1.76:3000/
Note that the development build is not optimized.
@stephencweiss
stephencweiss / Start from the master
Created October 25, 2018 13:07
Get the most recent information from the master
git checkout master
git fetch origin
git reset --hard origin/master
@stephencweiss
stephencweiss / Seed File
Created October 31, 2018 05:48
Using faker and moment to generate fake data to seed a database
const faker = require('faker');
const moment = require('moment');
const momentRandom = require('moment-random');
const Promise = require('bluebird');
const db = require('../models/models.js');
const createUser = () => {
const email = faker.internet.email();
const fullName = faker.name.findName();
const host = Math.random() <= 0.25;
@stephencweiss
stephencweiss / Feature Branch Workflow
Created November 1, 2018 00:58
Common Git commands for Feature Branch
// Prior to cutting a new branch
git fetch origin
git reset --hard origin/master
// Cut a new branch
git checkout -b MyNewFeature || git checkout -b Issue#124
git push origin MyNewFeature
//Helpful
git stash
@stephencweiss
stephencweiss / seed.js
Created November 15, 2018 23:39
Seed script to populate a MongoDB with 10m records -- including schema
const faker = require('faker');
const fs = require('fs');
const path = require('path');
const db = require('./index.js');
const Description = require('./db.js');
const generateRandomDescription = (productId) => {
productId = productId;
const productName = faker.commerce.productName();
```psql
sdc=# \dp descriptions
Access privileges
Schema | Name | Type | Access privileges | Column privileges | Policies
--------+--------------+-------+-------------------------+-------------------+----------
public | descriptions | table | Stephen=arwdDxt/Stephen+| |
| | | sdc=arwdDxt/Stephen | |
```