This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
export default class Item extends Component{ | |
constructor(props){ | |
super(props); | |
this.state = { | |
num: props.num, | |
isSaved: false | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Item from './Item'; | |
import './App.css'; | |
class App extends Component { | |
constructor(){ | |
super(); | |
this.state = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
let lsBus = {}; | |
let ssBus = {}; | |
/** | |
* Redraw all components that have a hook to localStorage with the given key. | |
* @param {string} key | |
* @param {*} newValue | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Sending Data to the Server using Fetch() | |
//using jsonplaceholder for the data | |
//GET - queryStrings | |
// http://jsonplaceholder.typicode.com/posts?userId=1&postId=65 | |
// http://jsonplaceholder.typicode.com/todos?userId=2 | |
//POST | |
// http://jsonplaceholder.typicode.com/posts | |
const root = 'http://jsonplaceholder.typicode.com/'; | |
let uri = root + 'posts'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const people = [ | |
{ id: 12, name: 'Billy', dob: '1998-10-05' }, | |
{ id: 123, name: 'Bart', dob: '1993-02-15' }, | |
{ id: 45, name: 'Belinda', dob: '1996-01-31' }, | |
{ id: 67, name: 'Bonnie', dob: '1998-04-09' }, | |
{ id: 89, name: 'Brenda', dob: '1996-07-08' }, | |
{ id: 34, name: 'Bobby', dob: '1994-09-12' }, | |
{ id: 234, name: 'Blake', dob: '2000-01-01' }, | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Scroll To Text Fragment</title> | |
<style> | |
* { | |
box-sizing: border-box; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>CSS Classes vs Ids</title> | |
<style> | |
* { | |
box-sizing: border-box; | |
padding: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
<style> | |
:root{ | |
--font: 1rem; | |
--line: calc(var(--font) * 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
<style> | |
html { | |
font-size: 20px; | |
font-weight: 300; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>FormData Objects</title> | |
</head> |