Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Considering new contract opportunities at this time

Andrew E. Rhyne thebigredgeek

💭
Considering new contract opportunities at this time
View GitHub Profile
@thebigredgeek
thebigredgeek / app.js
Last active Jul 21, 2019
Overload Lead Generation App
View app.js
import React, { useState, useRef } from 'react';
import { StyleSheet, View, KeyboardAvoidingView } from 'react-native';
import { Image, ThemeProvider, Input, Button } from 'react-native-elements';
import validator from 'validator'
import axios from 'axios'
import constants from './constants'
const { colors } = constants
@thebigredgeek
thebigredgeek / api.js
Created Jul 21, 2019
Overload Lead Gen API
View api.js
const express = require('express');
const helmet = require('helmet');
const axios = require('axios');
const bodyParser = require('body-parser')
const client = axios.create({
baseURL: 'https://api.prosperworks.com/developer_api',
headers: {
'X-PW-AccessToken': process.env.COPPER_CRM_API_KEY,
'X-PW-Application': 'developer_api',
@thebigredgeek
thebigredgeek / common.js
Created Oct 21, 2017
common class stuff in cs
View common.js
import React, { PureComponent } from 'react';
import { autobind } from 'core-decorators';
export default class Button extends PureComponent {
@autobind
_handleOnClick (e) {
e.preventDefault();
console.log('I was clicked!');
}
render () {
View client.js
import { Permissions, Notifications } from 'expo';
import { Platform } from 'react-native';
import client from '../state/apollo';
import mutation from '../graphql/mutations/userAddPushToken';
import Observable from './observable';
export const register = async () => {
@thebigredgeek
thebigredgeek / config.js
Last active Apr 24, 2017
RFC: "Solaris"
View config.js
{
"redis": {
"host": "localhost",
"port": 6379,
"prefix": "solaris-"
},
"port": 3000
}
@thebigredgeek
thebigredgeek / demo.graphql
Last active Dec 9, 2016
GraphQL query demo
View demo.graphql
myUser {
# My user's ID
id
name
email
createdAt
updatedAt
Posts {
# Posts that my user has created...
id
View radio.js
import React, { PropTypes } from 'react';
import classNames from 'classnames';
import { autobind } from 'core-decorators';
import withStyles from 'isomorph-style-loader/lib/withStyles';
import PureComponent from '../../components/common/pure';
import style from './radio.css';
@withStyles(style)
View baseResolvers.js
import { AlreadyAuthenticatedError, NotAuthenticatedError, NotAuthorizedError } from '../errors/functional';
import createResolver from '../lib/createResolver';
export const baseResolver = createResolver();
export const isAuthenticatedResolver = baseResolver.createResolver(
(root, args, context) => {
if (!context.user || !context.user.id) throw new NotAuthenticatedError();
}
@thebigredgeek
thebigredgeek / location.graphql
Created Dec 5, 2016
Apollo / GraphQL basics
View location.graphql
type Location implements Resource {
# Primary key
id: ID!
# Google's name for the Location
googleName: String!
# Google's ID for the Location
googleId: ID!
# Google's Place ID for the Location
googlePlaceId: ID!
# Google's Timezone ID for the Location
@thebigredgeek
thebigredgeek / input.js
Created Dec 1, 2016
Pure input component with external value and sticky cursor
View input.js
import React, { PropTypes } from 'react';
import classNames from 'classnames';
import { autobind } from 'core-decorators'
import PureComponent from './pure';
@withStyles(style)
export default class Input extends PureComponent {
static propTypes = {
onChange: PropTypes.func.isRequired,