Skip to content

Instantly share code, notes, and snippets.

View Spazcool's full-sized avatar
:shipit:
Ubiquitous Mendacious Polyglottal

Doug Wright Spazcool

:shipit:
Ubiquitous Mendacious Polyglottal
View GitHub Profile

What Happens When Your Browser Requests a Web Page?

  • Highest level = Client sends request to server > Server sends page/data to client

  • Slightly more nuance:

    1. Client sends HTTP request
    2. ISP via TCP/IP
    3. DNS (change name to ip)
    4. server receives request
  1. authentication / route matching ensues
@Spazcool
Spazcool / stateToAbbr.js
Created May 7, 2020 23:33 — forked from calebgrove/stateToAbbr.js
Convert state name to abbreviation in JavaScript. There's some better solutions in the comments, so scroll down!
// There's some better solutions in the comments, so scroll down and see how other folks have improved this!
// USAGE:
// abbrState('ny', 'name');
// --> 'New York'
// abbrState('New York', 'abbr');
// --> 'NY'
function abbrState(input, to){
@Spazcool
Spazcool / 1App.js
Last active April 12, 2018 13:16
Grandchild component (Card.js) can't access Parent component's (App.js) method
import Cards from './Components/Cards';
import Forms from './Components/Forms';
import React, { Component } from 'react';
import recipes from './recipes.js'; // mock data
import './App.css';
class App extends Component {
constructor(props) {
super(props);
this.state = {
@Spazcool
Spazcool / 1parent.js
Last active April 12, 2018 13:06
two-level method pass in React
import Child from './Child';
import React, { Component } from 'react';
import './App.css';
class App extends Component {
constructor(props){
super(props);
this.state={
trueOrfalse: true,
};