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 / 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';
<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 / 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);
@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 / 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 / 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 / GiftCard.jsx
Created September 12, 2018 23:30
conflicted file
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 / dvic_card_gallery.js
Created September 6, 2018 16:42
show event on base class
@ldco2016
ldco2016 / ternary.js
Created July 3, 2018 00:10
Control Flow
let isNightTime = true;
if (isNightTime) {
console.log('Turn on the lights!');
} else {
console.log('Turn off the lights!');
}
@ldco2016
ldco2016 / update.js
Created June 18, 2018 23:46
a couple of options
it('A model class can update one record', (done) => {
assertName(User.findOneAndUpdate(joe._id, { name: 'Bill' }), done);
});
it('A model class can find a record with an Id and update', (done) => {
assertName(User.findByIdAndUpdate(joe._id, { name: 'Bill' }), done);
});