Skip to content

Instantly share code, notes, and snippets.

Daniel Zuzevich DZuz14

Block or report user

Report or block DZuz14

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@DZuz14
DZuz14 / user-profile.js
Created Aug 22, 2019
User Profile Reducer
View user-profile.js
const initialState = {
submitting: false,
success: '',
error: '',
};
/**
* @function userProfile
*/
const userProfile = (state = initialState, action) => {
@DZuz14
DZuz14 / user-profile.js
Created Aug 22, 2019
User Profile Form With Action Creator
View user-profile.js
import React, { Component } from 'react';
import { submitProfileForm } from '../actions/profile-form';
export default class ProfileForm extends Component {
handleSubmit = e => {
e.preventDefault();
submitProfileForm();
};
render() {
@DZuz14
DZuz14 / user-profile.js
Last active Aug 22, 2019
User Profile Form, No Action Creator.
View user-profile.js
import React, { Component } from 'react';
import { submitProfileForm } from '../actions/profile-form';
export default class ProfileForm extends Component {
handleSubmit = e => {
e.preventDefault();
// Emit the action here!!!
};
render() {
View x.json
{
"away": {
"stats": {
"Junis": [
"5.0",
"4",
"1",
"1",
"2",
"6",
@DZuz14
DZuz14 / pitchers.js
Created Apr 27, 2019
ESPN MLB Pitcher Duplicates
View pitchers.js
1.) Grab each pitcher from table and their stats.
- Store them in object like:
```
{
'C. Sale': [5,2,3],
'H. Martinez': [20,9,4],
'R. Martinez': [3,7,1],
'J. Schmoe': [20,25,99],
'R. Kelly': [20,9,4],
'P. Kelly': [3,7,1],
@DZuz14
DZuz14 / async.js
Last active Jan 15, 2019
Async Await Promises
View async.js
function someCoolPromise() {
return new Promise((resolve, reject) => {
// You can do anything you want in here for as long as you want.
// Then just call the resolve function when you are ready.
for(let i = 0;i < 10000; i++) {
// weeeee
}
resolve({
@DZuz14
DZuz14 / example.js
Last active Dec 18, 2018
Real App.js Example
View example.js
import React, { Component } from 'react'
import Header from '~/components/header'
import Footer from '~/components/footer'
import Login from './login'
import Portfolio from '~/components/portfolio'
import { Switch, Route, Redirect } from 'react-router-dom'
import { ROOT_APP_URL } from '~/constants'
@DZuz14
DZuz14 / MarkdownPage.js
Created Aug 23, 2018
Temp Fix For Edit This Page On ReactJs.org
View MarkdownPage.js
{markdownRemark.fields.slug && (
<div css={{marginTop: 80}}>
<a
css={sharedStyles.articleLayout.editLink}
href={`https://github.com/reactjs/reactjs.org/tree/master/content/${
markdownRemark.fields.slug.replace('.html', '.md')
}`}>
Edit this page
</a>
</div>
View currencies.js
currencies: [
{
currencyName: 'Bitcoin',
marketCap: 106330074359
},
{
currencyName: 'Ethereum',
marketCap: 32402945322
},
{
@DZuz14
DZuz14 / Slider.js
Last active Oct 4, 2018
Slide Width Calculation
View Slider.js
import React, { Component } from 'react'
import Slide from '../slide'
import LeftArrow from '../left-arrow'
import RightArrow from '../right-arrow'
export default class Slider extends Component {
constructor(props) {
super(props)
this.state = {
You can’t perform that action at this time.