Skip to content

Instantly share code, notes, and snippets.

@YoneMoreno
YoneMoreno / FirstComponent.js
Created October 29, 2017 12:18
Samerbuna Learning React Clip First Component
class Button extends React.Component {
state = {counter: 0};
handleClick = () => {
this.setState((prevState) => ({
counter: prevState.counter + 1
}));
};
render(){
@YoneMoreno
YoneMoreno / CSS.css
Created October 29, 2017 18:26
Samerbuna Learning React Clip First Component
.mountNode {
color: #333;
}
.fa-star{
margin: 0.5em;
font-size: 24px;
}
span {
@YoneMoreno
YoneMoreno / TheStateOfSelectedNumbers.js
Created October 30, 2017 06:51
Samer Buna Module 5 Numbers Selection
const Stars = (props) => {
const numberOfStars = 1 + Math.floor(Math.random()*9);
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">
@YoneMoreno
YoneMoreno / SelectingANumber.js
Created October 30, 2017 07:06
Samer Buna Module 5 Creating a Game for kids React
const Stars = (props) => {
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">
@YoneMoreno
YoneMoreno / ChanginTheAnswer.js
Created October 30, 2017 07:17
Samer Buna React
const Stars = (props) => {
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">
@YoneMoreno
YoneMoreno / Enhancing the UI.js
Created October 30, 2017 07:24
Samer Buna React
const Stars = (props) => {
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">
@YoneMoreno
YoneMoreno / VeryfingAnAnswer.js
Created October 30, 2017 07:41
Samer Buna Getting Started React
const Stars = (props) => {
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">
@YoneMoreno
YoneMoreno / Redraws.js
Created October 30, 2017 09:46
Samer Buna getting started react
const Stars = (props) => {
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">
@YoneMoreno
YoneMoreno / DoneStatus.js
Created October 30, 2017 09:59
Samer Buna React
const Stars = (props) => {
/*
let stars = [];
for(let i=0; i<numberOfStars; i++){
stars.push(<i key={i} className="fa fa-star"></i>);
}
*/
return (
<div className="col-5">
@YoneMoreno
YoneMoreno / PracticeGoing&UpYDKJS.js
Created November 1, 2017 07:36
Doing the practice excercise in the first chapter of the book by Kyle called You Dont Know Javascript Going & Up
const taxRate = 0.07;
const phonePrice = Number(prompt("What is the price for the phone you are looking for?"));
const accessoryPrice = Number(prompt("How much bucks does the accesory cost?"));
const spendingThreshold = 200;
var accountBalance = Number(prompt("How much IS YOUR BANK ACCOUNT?"));
function calculateTax(purchasePrice){
return purchasePrice + purchasePrice*taxRate;