Skip to content

Instantly share code, notes, and snippets.

View GKephart's full-sized avatar
:shipit:
Investigating bugs.

George Kephart GKephart

:shipit:
Investigating bugs.
View GitHub Profile
import axios from "axios"
interface Post {
postId: string | null,
postUserId: number,
postContent: string,
postTitle: string
}
function dataDownloader() : Promise<any> {

Intro To React

React is a declarative frontend UI library created and maintained by Facebook. React is the most popular tool for creating beautiful responsive frontends. It was released to the public in 2013 to make code sharing easier by introducing the concept of a component to frontend development.

A component is a single UI element. This element can be as significant as a whole page or as simple as a small button. Components are the main building blocks of a react application and make it easy to share code in a single app or across multiple projects. The introduction of Components has made React into the most popular Frontend for the web and has made the component the default building block for all popular frontend frameworks Including Angular and Vue.

React and JSX

React uses a special subset of HTML called JSX. JSX stands for Javascript XML. Although it is possible to use React without JSX, we strongly advise against it. JSX is what made React the number one frontend tool on the web and allows

Functional React And Hooks

Functional Programming

  • Functional Programming is an approach of writing software based on the algebraic concept of functions.
  • Functional programming emphasizes the immutability of data, the use of pure functions, and avoidance of side effects.
  • immutable data: data that once declared is not changed or mutated.
  • pure function: a function that takes in a parameter and returns a unique value based on the parameter.
  • side effect: Any operation that affects the outside environment where the operation takes place.

React Provides Two Ways To Create Components

Class Based Components

Important terms

  • URLs
  • IP addresses
  • Localhost VS. public IP addresses/web hosting
  • Domain names attach to public IPs

Ports:

  • 80 - is the default port for http://
  • 443 - default port for https://
  • 22 - default port for ssh 7822
  • 3306: for mysql
<?php
/**
* One line description of what this function or method does. This text usually appears inside an <h1> tag.
*
* Detailed description of what this function or method does. This text usually appears inside an <p> tag.
*
* @param <type> $firstParameter an explanation of what this parameter does
* @param <type> $secondParameter an explanation of the second parameter
* @return <type> what this function or method returns
* @throws <type> what this function or method can throw, and why it will throw
@GKephart
GKephart / bracing.php
Created January 14, 2019 14:12
quick gist since the highlight package is down
<?php
function someFunction($firstParameter, $secondParameter) {
$answer = 0;
$limit = $firstParameter + $secondParameter;
for($i = 0; $i < $limit; $i++) {
if($i % 2 === 0) {
$answer = $answer + ($i + 2);
} else {
$answer = $answer + ($i + 1);
}

entity, noun, most important actors/aspects of a web site's data to be stored start with core nouns first to build a list of entities you will need and refine later

attribute, noun, an aspect of an entity that is data to be stored in both cases we want to store "data at rest" NOT "data in motion" number of favorites is data in motion that counts the data at rest

Ryan favorited @jsaul Dylan favorited @jsaul

/*****************************************************
* CSS Mockup Activity - Custom CSS Stylesheet
* @author rlewis37
*
* Some rules have been included here to give you a head start.
* Create your own custom CSS rules below. Have fun!
******************************************************/
html, body {
margin: 0;
box-sizing: border-box;
@GKephart
GKephart / checklist.md
Last active June 8, 2020 22:37
Deep Dive Project Creation Checklist

Deep Dive Project Creation Checklist

Create New Repository on Github

  • go to github.com
  • click the plus sign on the navbar
  • select new repository from the dropdown
  • fill in repository name (project-name) and description fields
  • select public
  • select initialize with readme
  • select Apache license 2.0
  • click create new file
@GKephart
GKephart / Tweet.php
Last active May 4, 2017 15:16
easy bug creation
<?php
/**
* gets an array of tweets based on its date
* (this is an optional get by method and has only been added for when specific edge cases arise in capstone projects)
*
* @param \PDO $pdo connection object
* @param \DateTime $sunriseTweetDate beginning date to search for
* @param \DateTime $sunsetTweetDate ending date to search for
* @return \SplFixedArray of tweets found
* @throws \PDOException when mySQL related errors occur