Skip to content

Instantly share code, notes, and snippets.

View jsjoeio's full-sized avatar

Joe Previte jsjoeio

View GitHub Profile
@jsjoeio
jsjoeio / gist:e4ee9c70d6703f1457c016ab7922375e
Last active December 13, 2017 21:08
Twilio App - help
#### npm install --global yarn
Josephs-MacBook-Pro:~ josephprevite$ npm install --global yarn
npm WARN deprecated [email protected]: It is recommended to install Yarn using the native installation method for your environment. See https://yarnpkg.com/en/docs/install
/usr/local/bin/yarnpkg -> /usr/local/lib/node_modules/yarn/bin/yarn.js
/usr/local/bin/yarn -> /usr/local/lib/node_modules/yarn/bin/yarn.js
+ [email protected]
updated 1 package in 0.929s
Josephs-MacBook-Pro:~ josephprevite$ brew install yarn
Josephs-MacBook-Pro:call-forwarding-node-master josephprevite$ yarn start
yarn run v1.3.2
$ node ./bin/www
::1 - - [14/Dec/2017:02:15:35 +0000] "GET / HTTP/1.1" 200 1172 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"
::1 - - [14/Dec/2017:02:15:35 +0000] "GET /static/css/main.css HTTP/1.1" 404 158 "http://localhost:3000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"
::1 - - [14/Dec/2017:02:15:36 +0000] "GET /static/css/main.css HTTP/1.1" 404 158 "http://localhost:3000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"
::1 - - [14/Dec/2017:02:15:36 +0000] "GET /favicon.ico HTTP/1.1" 404 150 "http://localhost:3000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"
::1 - - [14/Dec/2017:02:15:44 +0000] "GET /stati
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-TRACKING-CODE"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-10563834-2');
</script>
@jsjoeio
jsjoeio / drills.js
Created January 24, 2018 03:42
Thinkful - Number drills
function computeArea(width, height) {
return width * height;
}
function celsToFahr(celsTemp) {
// your code here
return celsTemp * (9/5) + 32;
}
function fahrToCels(fahrTemp) {
@jsjoeio
jsjoeio / navigation-bar.js
Last active February 13, 2018 03:56
Component drill - navigation-bar
/*
First thing we need to do is import the React library which we can do with the syntax
import NAME_WE_DECLARE from 'library-name'
So theoretically, we could import the 'react' library as Puppies. It would be confusing but just know that you can call it what you want.
*/
import React from 'react';
// Next, in this file, we import the CSS styles using the following:
import './navigation-bar.css';
@jsjoeio
jsjoeio / AddForm.js
Created February 17, 2018 17:09
Thinkful - React interactivity - AddForm component
import React from 'react';
import './add-form.css';
//First, we create a class component called AddForm
export default class AddForm extends React.Component {
constructor(props) {
super(props);
//when we define the state, we want to set a default value for text because we want to control the input.
@jsjoeio
jsjoeio / trelloAddFormAndList.js
Created February 17, 2018 17:41
JS - React - passing data from child to parent component
//To give some context, this is an example taken from Thinkful's curriculum. This section of the curriculum uses a simple React app that creates a clone of Trello.
//We will be looking at two components: an AddForm component (child) and a List component (parent)
//This gist aims to show how we pass data from the child component to the parent component. I will do this by adding in comments throughout the code for each component.
//The code for the child component.
import React from 'react';
import './add-form.css';
@jsjoeio
jsjoeio / comparison.md
Last active October 10, 2024 14:09
axios vs. isomorphic-fetch

Which library should you use for making HTTP requests from a React/Node project?

In this doc, we'll explore two popular libraries: axios and isomorphic-fetch.

axios

Quick facts:

  • 37,439 stars on GitHub
  • 130 contributors
  • most recent commit: March 8th, 2018
  • created in Aug. 2014
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@jsjoeio
jsjoeio / README-Template.md
Created April 13, 2018 18:16 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites