Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Daniel Zuzevich DZuz14

🎯
Focusing
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 / data.json
Last active Jan 21, 2020
Thumbnail Gallery Fix
View data.json
[
{
"imgUrl": "https://images.unsplash.com/photo-1531366936337-7c912a4589a7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80",
"title": "Aurora Borealis",
"bodyText": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
},
{
"imgUrl": "https://images.unsplash.com/photo-1505689151358-52c00af435e5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1929&q=80",
"title": "Vast Canyon",
"bodyText": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
@DZuz14
DZuz14 / readme.md
Last active Jan 19, 2020
Gatsby Config Suggestions
View readme.md

Gatsby Config Suggestions

Here are the following errors I receive on my Windows 10 machine using gatsby ^2.18.12. At the bottom of the file, I've included the specs of my computer for reference. I decided to remove stack trace info, as it really doesn't matter at the moment.

Top Level Keys

If a top level key is misspelled or a an invalid key is added.

  • Change "plugins" to "plugin".
@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>
You can’t perform that action at this time.