Skip to content

Instantly share code, notes, and snippets.

View ldco2016's full-sized avatar
🏠
Working from home

Daniel Cortes ldco2016

🏠
Working from home
  • Jacksonville, TX
View GitHub Profile
@ldco2016
ldco2016 / GiftCard.jsx
Created September 12, 2018 23:35
conflict puke
import React from 'react';
import Tooltip from "../Widgets/Tooltip";
import BackupPaymentBlurb from "./BackupPaymentBlurb";
import CardPayment from "./CardPayment";
import {normalizeCreditCard} from '../../lib/Format';
import errorStrings from '../../assets/strings/errors.json';
import store from '../../store';
import PaymentMethodsFromWallet from './PaymentMethodsFromWallet';
import config from '../../config';
@ldco2016
ldco2016 / statuses.js
Created October 1, 2018 21:13
const and let
var statuses = [
{ code: 'OK', response: 'Request successful' },
{ code: 'FAILED', response: 'There was an error with your request' },
{ code: 'PENDING', response: 'Your reqeust is still pending' }
];
var message = '';
var currentCode = 'OK';
for (var i = 0; i < statuses.length; i++) {
if (statuses[i].code === currentCode) {
@ldco2016
ldco2016 / props.js
Created December 12, 2018 03:13
Passing Props
// original code
<script type="text/babel" data-presets="env,react">
const App = () => {
return (
<div>
<Message />
</div>
);
}
@ldco2016
ldco2016 / index.js
Created December 21, 2018 04:17
Node app server for Docker container with Redis
const express = require('express');
const redis = require('redis');
client.set('visits', 0);
const app = express();
const client = redis.createClient();
app.get('/', (req, res) => {
client.get('visits', (err, visits) => {
res.send('Number of visits is' + visits);
<Grid item xs={11}>
<img src="/images/brand.png" height="75px" width="75px" alt="application icon" />
<h2 className={classes.headerText}>
Welcome to Birdseye!
</h2>
<InputLabel shrink htmlFor="bootstrap-input" className={classes.bootstrapFormLabel}>
Email Address
@ldco2016
ldco2016 / SignInContainer.js
Created February 11, 2019 15:19
original container
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import { Grid, Link, InputLabel, InputBase, Input, Typography } from '@material-ui/core';
import Button from '@material-ui/core/Button';
import { Redirect } from 'react-router';
import classNames from 'classnames';
import gql from 'graphql-tag';
import { Mutation } from 'react-apollo';
import React from 'react';
import {View, StyleSheet, ActivityIndicator } from 'react-native';
// import Spinner from 'react-native-spinkit';
import PropTypes from 'prop-types';
// import {v2Colors} from 'theme';
// import {moderateScale} from 'react-native-size-matters';
const Loading = (props) => (
<View style={styles.container}>
<ActivityIndicator {...props}
@ldco2016
ldco2016 / reactNative.js
Created June 4, 2019 18:10
reducer and ShareNavBarButton
// src/action-alerts/reducer.js:
import * as types from 'action-alerts/constants';
import * as helpers from 'action-alerts/helpers/reducer-helpers';
const INITIAL_STATE = {
alerts: [],
email: '',
error: null,
loading: false,
@ldco2016
ldco2016 / App.js
Last active June 26, 2019 22:18
Reactotron mission
//eslint-disable-next-line
console.ignoredYellowBox = ["Setting a timer"];
import "./ReactotronConfig";
import React, { PureComponent } from "react";
import {
StyleSheet,
View,
StatusBar,
Linking,
Platform,
@ldco2016
ldco2016 / BaseSettingsPage.js
Created July 12, 2019 16:13
Base Settings Page component code
import React from "react";
import PropTypes from "prop-types";
import { bindActionCreators } from "redux";
import { connect } from "react-redux";
import glamorous from "glamorous";
import { Button } from "../../../../common/components";
import { Card, CardText } from "react-toolbox/lib/card";
import { getCurrentUser } from "../../../../redux-modules/current-user";
import { withLoading } from "../../../../redux-modules/loading-overlay";
import PreferencesActions from "../../actions/customers/preferences";