Skip to content

Instantly share code, notes, and snippets.

View jbaxleyiii's full-sized avatar
💼
Moved to management

James Baxley jbaxleyiii

💼
Moved to management
View GitHub Profile
@jbaxleyiii
jbaxleyiii / app.js
Created June 4, 2017 03:58
tree error
// @flow
import React from "react";
import ApolloClient, { createNetworkInterface } from "apollo-client";
import { ApolloProvider } from "react-apollo";
import Character from "./Character";
export const networkInterface = createNetworkInterface({
uri: "https://mpjk0plp9.lp.gql.zone/graphql",
});
export const withCharacter: OperationComponent<Response, InputProps> = graphql(HERO_QUERY, {
options: ({ episode }) => ({
// $ExpectError [string] This type cannot be compared to number
variables: { episode: episode > 1 },
})
});
+ import type { OperationComponent, QueryProps } from "react-apollo";
- import type { OperationComponent } from "react-apollo";
+ export type Props = Response & QueryProps;
+ export const withCharacter: OperationComponent<Response, InputProps, Props> = graphql(HERO_QUERY, {
- export const withCharacter: OperationComponent<Response, InputProps> = graphql(HERO_QUERY, {
options: ({ episode }) => ({
variables: { episode },
export const withCharacter: OperationComponent<Response, InputProps Props> = graphql(HERO_QUERY, {
options: ({ episode }) => ({
variables: { episode },
}),
props: ({ data, ownProps }) => ({
...data,
// $ExpectError [string] This type cannot be compared to number
episode: ownProps.episode > 1,
// $ExpectError property `isHero`. Property not found on object type
isHero: data && data.hero && data.hero.isHero,
SELECT
P.Id,
P.FirstName,
P.LastName,
P.Email
FROM
[Person] P
JOIN [PersonAlias] PA
ON PA.PersonId = P.Id
JOIN [PersonalDevice] PD
SELECT COUNT(*)
FROM [FinancialPersonSavedAccount] FPA
JOIN [FinancialPaymentDetail] FP
ON FPA.FinancialPaymentDetailId = FP.Id
WHERE
FP.CurrencyTypeValueId = 156
AND FPA.FinancialGatewayId = 3
AND FP.CreditCardTypeValueId = null
@jbaxleyiii
jbaxleyiii / _vimrc
Last active June 27, 2017 16:59
_vimrc
set nocompatible
syntax enable
filetype off
filetype on
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" install Vundle bundles
if filereadable(expand("~/.vimrc.bundles"))
@jbaxleyiii
jbaxleyiii / tmux-cheatsheet.markdown
Created July 14, 2017 23:56 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jbaxleyiii
jbaxleyiii / component.tsx.diff
Created July 19, 2017 02:50
TypeScript and React Apollo
import React from "react";
import gql from "graphql-tag";
import { graphql } from "react-apollo";
export const HERO_QUERY = gql`
query GetCharacter($episode: Episode!) {
hero(episode: $episode) {
name
id
friends {
export default withCharacter(({ loading, hero, error }) => {
// Operator '>' cannot be applied to types 'boolean' and 'number'.
if (loading > 1) return <div>Loading</div>;
if (error) return <h1>error.name</h1>;
return ...;
}