Skip to content

Instantly share code, notes, and snippets.

View MarkNewcomb1's full-sized avatar

MarkNewcomb MarkNewcomb1

View GitHub Profile
@MarkNewcomb1
MarkNewcomb1 / Async with react
Last active December 7, 2018 16:37
Async with react
const apiUrl = './dinosaurs.json'
// constructor stuff
componentDidMount() {
this.fetchProfiles()
}
async fetchProfiles() {
const response = await fetch(apiUrl)
@MarkNewcomb1
MarkNewcomb1 / CLI shortcuts.md
Created October 11, 2018 16:38
CLI shortcuts

^u # Erases input from current location to beginning of line.

^k # Erases input from the current location to the end of the line.

^a # Jump to beginning of line.

^e # Jump to end of line.

^z # Suspend a program that may be running and gives you another shell prompt.

@MarkNewcomb1
MarkNewcomb1 / Angular notes.md
Last active October 8, 2018 22:44
Angular notes

*ngIf - structural directive (meaning it affects what's output in the DOM) that's conditional on a expression evaluating to true

*ngFor - structural directive (meaning it affects what's output in the DOM) that's conditional on how many elements to loop through and render there are.

lifecycle hooks - as Angular initializes, it goes through certain phases.

First is ngOnChanges - when properties receive new values

ngOnInit - runs after the constructor - once component is initialized (but not added to the DOM) - basically once the object's created

@MarkNewcomb1
MarkNewcomb1 / Life Lessons from CJ
Created October 5, 2018 14:12
Life Lessons from CJ
* Life Lesson #1 - Learn by Doing
* Just build shit, then build more shit and after that build more shit.
* Don't be afraid to break things.
* Life Lesson #2 - Make Friends and Be Nice to _Everyone_
* You never know when they'll be able to help you with something
* And if they don't, you made a friend out of it, get over yourself
* Life Lesson #3 - It's much harder to say no to a working thing/prototype than it is to say no to an idea of a thing
* No one _asked me_ to automate the process.
* I did not ask for permission to do it, I just _did it_
* Life Lesson #4 - Doing _nothing_ for money is not rewarding
@MarkNewcomb1
MarkNewcomb1 / Basic firebase deploy
Created October 4, 2018 21:24
Basic firebase deploy
# Static Site Deployment
These instructions will lead you through how to deploy a static website on firebase
## Instructions
1. Fork and clone this repo
1. Change into the `practice directory` from your command line
1. Sign up for an account on [Firebase](https://firebase.google.com/).
1. In your terminal, install the Firebase CLI tools
@MarkNewcomb1
MarkNewcomb1 / Deploying react app to firebase
Created October 3, 2018 19:11
Deploying react app to firebase
// Log into firebase and create a project
// Make sure npm isn’t running anything any place in any terminal
// Change to your react app folder
*npm run build*
// creates a build folder and merges files into a compact build version
*firebase init*
// select hosting
// select your project
// *type build as your public directory*
@MarkNewcomb1
MarkNewcomb1 / Deploying angular app to firebase
Created October 3, 2018 19:07
Deploying angular app to firebase
/ Log into firebase and create a project
// Make sure npm isn’t running anything any place in any terminal
// Change to your angular app folder.
//For me, I did the first dino drill in angular, and so I was in the version-1 folder, and my project folder was named drill1angular. So, from the version-1 folder, I typed `cd drill1angular`
*ng build --prod*
// creates a build folder and merges files into a compact build version.
// Now...cd into your dist/project-folder. Again, I named my project folder drill1angular, and since I was already in version-1/drill1angular, I typed cd dist/drill1angular. _Yes, now there's two project folders named the same thing that are in different places._ Make _sure_ you're in the project folder inside the dist folder. For me, that path was version-1/drill1angular/dist/drill1angular
*firebase init*
// select hosting
// select your project

Capstone Project Proposal

Please complete this project proposal thoroughly so that your instructors can review it and have an intelligent conversation with you about requirements, scope, feasiblity, etc. Proposals will be due by the end of day on Friday before capstones start. If you don't have your idea fully fleshed out, complete the portions of this you can so that an instructor can help you flesh out the rest of your idea.

Project Description

A Build Your Custom Guitar web app for guitar players to create a custom-built guitar body with their body, wood, and finish of their choosing. At the end of the build, they will see an overview of the specs they've choosen and will be able to "purchase" the build.

Problem Statement

Setting Up New Project with Postgres, Knex, Express

All right, let's start :

-create a new repo on Github

git clone repo

-add a .gitignore and at the very least type in node_modules and .env

@MarkNewcomb1
MarkNewcomb1 / app.js
Created July 30, 2018 17:33
barebones express server
const express = require('express')
const app = express()
const bodyParser = require('body-parser')
const port = 9000
const cors = require('cors')
app.use(cors())
app.use(bodyParser.json())